Package hygiene #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "**/README.md" | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
cache: npm | |
- run: npm install --no-save express koa | |
- run: npm ci | |
- run: npm run check | |
- run: npm test -- --collectCoverage | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage/ | |
test-matrix: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node: ["18", "20", "latest"] | |
deps: | |
- [email protected] | |
- [email protected] | |
- fastify@4 fastify-plugin@4 | |
- fastify@3 fastify-plugin@3 | |
- [email protected] | |
- [email protected] | |
- "@nestjs/core@10 @nestjs/common@10 @nestjs/platform-express@10 @nestjs/testing@10" | |
- "@nestjs/core@9 @nestjs/common@9 @nestjs/platform-express@9 @nestjs/testing@9" | |
- "@nestjs/core@8 @nestjs/common@8 @nestjs/platform-express@8 @nestjs/testing@8" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ matrix.node }}" | |
cache: npm | |
- run: npm ci | |
- run: npm install --no-save ${{ matrix.deps }} | |
- run: npm test -- tests/express | |
if: contains(matrix.deps, 'express') | |
- run: npm test -- tests/fastify | |
if: contains(matrix.deps, 'fastify') | |
- run: npm test -- tests/koa | |
if: contains(matrix.deps, 'koa') | |
- run: npm test -- tests/nestjs | |
if: contains(matrix.deps, 'nestjs') |