Skip to content

Commit

Permalink
build: Run test on multiple node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vio committed Jul 27, 2023
1 parent 85f7474 commit 4a17c8e
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:

jobs:
test:
build-and-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -31,8 +31,8 @@ jobs:
- name: Build
run: npm run build

- name: Test
run: npm run test
- name: Lint
run: npm run lint

- name: Upload dist files
uses: actions/upload-artifact@v3
Expand All @@ -42,6 +42,40 @@ jobs:
path: |
lib/**/*
test:
needs:
- build-and-lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [20, 18, 16, 14]
steps:
- uses: actions/checkout@v3

# Cache packages when the branch is not update-dependencies or dependabot/*
- name: Resolve caching
id: cache
if: ${{ github.ref_name != 'update-dependencies' && !startsWith(github.ref_name, 'dependabot/') }}
run: echo "PACKAGE=npm" >> $GITHUB_OUTPUT

- name: Use Node.js
uses: actions/[email protected]
with:
node-version: ${{ matrix.version }}
cache: ${{ steps.cache.outputs.PACKAGE }}

- name: Install dependencies
run: npm ci

- name: Download dist files
uses: actions/download-artifact@v3
with:
name: dist-files

- name: Test
run: npm run test

publish:
# Run only for version tags
if: contains(github.ref, 'refs/tags/v')
Expand Down

0 comments on commit 4a17c8e

Please sign in to comment.