Skip to content

Commit

Permalink
ci: automatically test on all LTS node
Browse files Browse the repository at this point in the history
with example for testing on extra versions
  • Loading branch information
msimerson committed Mar 27, 2024
1 parent 9e1b2cd commit 4405afc
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,34 @@ on:

jobs:
build:
runs-on: ubuntu-latest
needs: [ get-lts ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
node: ${{ fromJson(needs.get-lts.outputs.active) }}
# include:
# - node: 22
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Test
run: npm test

get-lts:
runs-on: ubuntu-latest
steps:
- id: get
uses: msimerson/node-lts-versions@v1
outputs:
lts: ${{ steps.get.outputs.lts }}
active: ${{ steps.get.outputs.active }}

0 comments on commit 4405afc

Please sign in to comment.