-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (88 loc) · 2.61 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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/[email protected]
check-attw:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: npm
- name: Install dependencies
run: npm ci
- 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: latest
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", "latest"]
deps:
- fastify@4 fastify-plugin@4
- fastify@3 fastify-plugin@3
- "@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')