-
Notifications
You must be signed in to change notification settings - Fork 208
110 lines (106 loc) · 3.06 KB
/
ci.yml
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
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Continous Integration
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
jobs:
test:
name: Test
timeout-minutes: 60
strategy:
matrix:
os: [ubuntu-latest]
node-version: [14, 16, 17, 18]
mongodb-version: [4.4]
redis-version: [6]
include:
- os: windows-latest
node-version: 16
- os: macos-latest
node-version: 16
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Start MongoDB Ubuntu
if: matrix.os == 'ubuntu-latest'
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Start Redis Ubuntu
if: matrix.os == 'ubuntu-latest'
uses: supercharge/[email protected]
with:
redis-version: ${{ matrix.redis-version }}
- name: Start MongoDB Windows
if: matrix.os == 'windows-latest'
run: powershell .\bin\windows\install-mongodb.ps1
- name: Start Redis Windows
if: matrix.os == 'windows-latest'
run: |
nuget install redis-64 -excludeversion
redis-64\tools\redis-server.exe --service-install
redis-64\tools\redis-server.exe --service-start
'@ECHO Redis Started'
- name: Start MongoDB MacOS
if: matrix.os == 'macos-latest'
run: |
brew tap mongodb/brew
brew install [email protected]
brew services start [email protected]
- name: Start Redis MacOS
if: matrix.os == 'macos-latest'
run: |
brew install redis
brew services start redis
- name: Bootstrap project
run: |
npm ci --ignore-scripts
npm run postinstall
- name: Build project
run: npm run build
- name: Run tests
run: npm run test:ci
code-lint:
name: Code Lint
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16
- name: Bootstrap project
run: |
npm ci --ignore-scripts
npm run postinstall
- name: Verify code linting
run: npm run lint
commit-lint:
name: Commit Lint
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16
- name: Bootstrap project
run: |
npm ci --ignore-scripts
npm run postinstall
- name: Verify commit linting
run: npx commitlint --from origin/master --to HEAD --verbose