-
Notifications
You must be signed in to change notification settings - Fork 13
87 lines (63 loc) · 2.01 KB
/
workflow.yml
File metadata and controls
87 lines (63 loc) · 2.01 KB
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
name: CI
on: [push]
jobs:
build:
# https://github.com/actions/runner-images#available-images
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install npm dependencies
run: npm ci
- name: Static analysis
run: npm run lint
- name: Check formatting
run: npm run format:check
- name: Unit tests
run: npm run test:cov
- name: Build and run containers
run: docker compose up --build -d
- name: Run acceptance tests
run: npm run test:acceptance
- name: Wait for services to be ready with migrations
run: sleep 30
- name: Run e2e tests
run: npm run test:e2e
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
- name: Stop containers
if: always()
run: docker compose down
- name: Run ldap containers
run: docker compose -f docker-compose.yml -f docker-compose.ldap.yml up -d
- name: Run ldap test
run: npm run test:ldap
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
- name: Stop ldap containers
if: always()
run: docker compose -f docker-compose.yml -f docker-compose.ldap.yml down
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v6
env:
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
test-migrations:
# See: https://github.com/Visual-Regression-Tracker/backend/issues/273
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install npm dependencies
working-directory: prisma
run: npm ci
- name: Static analysis
working-directory: prisma
run: npm run test