-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 1.52 KB
/
main-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
name: Main CI
on:
push:
branches:
- main
-dev
pull_request:
branches:
- main
- dev
jobs:
build-backend:
name: Build Backend
uses: ./.github/workflows/build.yml
with:
image: ghcr.io/dnum-mi/referentiel-applications/backend
context: ./backend
build-frontend:
name: Build Frontend
uses: ./.github/workflows/build.yml
with:
image: ghcr.io/dnum-mi/referentiel-applications/frontend
context: ./frontend
test-format:
name: Test Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Prettier check
run: |
npm ci
npm run format-check
test-backend:
name: Test Backend
needs: build-backend
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Start stack using docker compose
run: IMAGE_TAG=${{ needs.build-backend.outputs.image_tag }} docker compose -f docker-compose.yml -f docker-compose.ci.yml up backend postgres -d
- run: docker compose exec backend npx prisma migrate deploy
- run: docker compose exec backend pnpm run test:cov
- name: Produce the coverage report
uses: insightsengineering/coverage-action@v2
with:
coverage-summary-title: Backend Coverage Summary
path: ./backend/coverage/cobertura-coverage.xml
publish: true
# threshold: 80
diff-storage: _xml_coverage_reports_backend