-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.2 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
name: CI
on:
push:
branches: [ "master"]
paths-ignore:
- "README.md"
pull_request:
branches: [ "master" ]
jobs:
test:
services:
mongo:
image: mongo:6.0.20
ports:
- 27017:27017
# health check
# ref: https://engineering.synatic.com/a-simple-way-to-run-a-mongodb-replica-set-in-github-actions
options: >-
--health-cmd "mongosh --eval 'db.runCommand(\"ping\")'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MONGODB_URI: mongodb://localhost:27017
strategy:
matrix:
directory: [ "./backend" ]
name: 🎉 Test
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ${{ matrix.directory }}/.nvmrc
- name: 📦 Install dependencies
working-directory: ${{ matrix.directory }}
run: npm ci
- name: Linter
working-directory: ${{ matrix.directory }}
run: npm run lint
- name: Test
working-directory: ${{ matrix.directory }}
run: npm test