Skip to content

Commit

Permalink
Merge pull request #15 from jankapunkt/ci-node-14-16-18
Browse files Browse the repository at this point in the history
Use matrix tests for node 14,16,18 in ci
  • Loading branch information
jankapunkt authored Oct 31, 2022
2 parents 4d37d9e + 68df773 commit 28a6b81
Showing 1 changed file with 48 additions and 43 deletions.
91 changes: 48 additions & 43 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,56 @@ jobs:
name: Javascript standard lint
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2

- name: setup node
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: cache dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm run lint
- name: checkout
uses: actions/checkout@v3

- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16

- name: cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm run lint

unittest:
name: mocha unit tests
name: unit tests
runs-on: ubuntu-latest
needs: [lintjs]
strategy:
matrix:
node: [14, 16, 18]
steps:
- name: checkout
uses: actions/checkout@v2

- name: setup node
uses: actions/setup-node@v1
with:
node-version: '12.x'

- name: cache dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm run test:coverage

- name: check coverage
uses: devmasx/coverage-check-action@v1.2.0
with:
type: lcov
result_path: coverage/lcov.info
min_coverage: 90
token: ${{github.token}}
- name: Checkout ${{ matrix.node }}
uses: actions/checkout@v3

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Cache dependencies ${{ matrix.node }}
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}
- run: npm i
- run: npm run test:coverage

# with the following action we enforce PRs to have a high coverage
# and ensure, changes are tested well enough so that coverage won't fail
- name: check coverage
uses: devmasx/coverage-check-action@v1.2.0
with:
type: lcov
result_path: coverage/lcov.info
min_coverage: 90
token: ${{github.token}}

0 comments on commit 28a6b81

Please sign in to comment.