-
Notifications
You must be signed in to change notification settings - Fork 95
97 lines (83 loc) · 3.08 KB
/
ci.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
93
94
95
96
97
name: CI
on:
push:
paths:
- '.github/workflows/ci.yaml'
- 'src/**'
- 'package.json'
- 'tsconfig.json'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ['16', '18']
nest-version: ['5', '6', '7', '8', '9', '']
include:
- { node-version: '10', nest-version: '5' }
- { node-version: '10', nest-version: '6' }
- { node-version: '10', nest-version: '7' }
- { node-version: '10', nest-version: '8' }
- { node-version: '12', nest-version: '5' }
- { node-version: '12', nest-version: '6' }
- { node-version: '12', nest-version: '7' }
- { node-version: '12', nest-version: '8' }
- { node-version: '12', nest-version: '9' }
- { node-version: '14', nest-version: '5' }
- { node-version: '14', nest-version: '6' }
- { node-version: '14', nest-version: '7' }
- { node-version: '14', nest-version: '8' }
- { node-version: '14', nest-version: '9' }
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm config set legacy-peer-deps true
npm install
- name: Install nestjs
if: matrix.nest-version
run: npm install @nestjs/common@^${{ matrix.nest-version }} @nestjs/core@^${{ matrix.nest-version }} @nestjs/testing@^${{ matrix.nest-version }}
- name: Install platform-express
if: >-
startsWith(matrix.nest-version, '6') ||
startsWith(matrix.nest-version, '7') ||
startsWith(matrix.nest-version, '8') ||
startsWith(matrix.nest-version, '9')
run: npm install @nestjs/platform-express@^${{ matrix.nest-version }}
# nestjs 5.x-7.x supports rxjs 6.x
- name: Install rxjs
if: >-
startsWith(matrix.nest-version, '5') ||
startsWith(matrix.nest-version, '6') ||
startsWith(matrix.nest-version, '7')
run: npm install rxjs@^6
# node 10.x supports jest 27.x but it doesn't work when installed this way
- name: Install jest 26
if: startsWith(matrix.node-version, '10')
run: npm install jest@^26 ts-jest@^26 @types/jest@^26
# jest 29.x droppped support for node 12.x
- name: Install jest 28
if: startsWith(matrix.node-version, '12')
run: npm install jest@^28 ts-jest@^28 @types/jest@^28
# rimraf 4.x does not support node below 14.x
- name: Install rimraf
if: >-
startsWith(matrix.node-version, '8') ||
startsWith(matrix.node-version, '10') ||
startsWith(matrix.node-version, '12')
run: npm install rimraf@^3
- name: Lint
if: startsWith(matrix.node-version, '18')
run: npm run lint
- name: Test
run: npm test
- name: Build
run: npm run build