Skip to content

Commit

Permalink
replace node version matrix by reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
matiassimon committed Jan 28, 2024
1 parent 021714a commit 08490ef
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 41 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test workflow

on:
workflow_call:
inputs:
node-version:
required: true
type: number

jobs:
test:
name: '${{ matrix.package }} - node.js v${{ inputs.node-version }}'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- apollo-server-graphql-api
- async-setup-with-delay
- async-setup-with-file
- babel
- express-rest-api
- karma
- node-sqlite3
- playwright
- programmatic-usage
- puppeteer
- react-webpack
- rxjs
- selenium
- third-party-reporter
- typescript
- typescript-babel
- vue-puppeteer
steps:
- uses: actions/setup-node@v4
with:
node-version: '${{ inputs.node-version }}'
- uses: actions/checkout@v4
- name: Install dependencies
run: |
cd packages/${{ matrix.package }}
npm install
- name: Run tests
run: |
cd packages/${{ matrix.package }}
npm run test
55 changes: 14 additions & 41 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,17 @@ name: Tests
- cron: '0 6 * * 0'

jobs:
test:
name: '${{ matrix.package-folder }} - Node.js v${{ matrix.node }}'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package-folder:
- apollo-server-graphql-api
- async-setup-with-delay
- async-setup-with-file
- babel
- express-rest-api
- karma
- node-sqlite3
- playwright
- programmatic-usage
- puppeteer
- react-webpack
- rxjs
- selenium
- third-party-reporter
- typescript
- typescript-babel
- vue-puppeteer
node:
- 14
- 16
- 18
steps:
- uses: actions/setup-node@v4
with:
node-version: '${{ matrix.node }}'
- uses: actions/checkout@v4
- name: Install dependencies
run: |
cd packages/${{ matrix.package-folder }}
npm install
- name: Run tests
run: |
cd packages/${{ matrix.package-folder }}
npm run test
test-node-v14:
uses: ./.github/workflows/test-workflow.yml
with:
node-version: 14

test-node-v16:
uses: ./.github/workflows/test-workflow.yml
with:
node-version: 16

test-node-v18:
uses: ./.github/workflows/test-workflow.yml
with:
node-version: 18

0 comments on commit 08490ef

Please sign in to comment.