Lock file maintenance #163
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: | |
paths-ignore: | |
- .gitignore | |
- LICENSE | |
- README.md | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- uses: pre-commit/action@v3.0.1 | |
check-attw: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.4.x | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build | |
- name: Check if types are wrong with attw | |
run: npx -p @arethetypeswrong/cli attw --pack . | |
test-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22.4.x | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Run checks | |
run: npm run check | |
- name: Run tests with coverage | |
run: npm test | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage/ | |
test-matrix: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node: ["18", "20", "22.4.x"] | |
deps: | |
- express@4.19 | |
- express@4.18 | |
- express@4.17 | |
- fastify@4 fastify-plugin@4 | |
- fastify@3 fastify-plugin@3 | |
- koa@2.15 | |
- koa@2.14 | |
- koa@2.13 | |
- "@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 | |
- name: Install dependencies | |
run: npm ci | |
- name: Override dependencies from matrix | |
run: npm install --no-save ${{ matrix.deps }} | |
- name: Run tests for Express | |
run: npm test -- tests/express | |
if: contains(matrix.deps, 'express') | |
- name: Run tests for Fastify | |
run: npm test -- tests/fastify | |
if: contains(matrix.deps, 'fastify') | |
- name: Run tests for Koa | |
run: npm test -- tests/koa | |
if: contains(matrix.deps, 'koa') | |
- name: Run tests for NestJS | |
run: npm test -- tests/nestjs | |
if: contains(matrix.deps, 'nestjs') |