-
Notifications
You must be signed in to change notification settings - Fork 6
103 lines (89 loc) · 3.32 KB
/
quality-assurance.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
name: Quality Assurance
on:
workflow_dispatch:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
types: [opened, synchronize, reopened]
schedule:
- cron: 0 16 * * *
jobs:
pre-commit-checks:
name: pre-commit-checks
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: pull needed docker images
run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml pull pre-commit-check
- name: Run pre commit checks
run: |
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --abort-on-container-exit --exit-code-from pre-commit-check pre-commit-check
acceptance-tests:
name: acceptance-tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: pull needed docker images
run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml pull behave
- name: Run behave tests
run: |
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --abort-on-container-exit --exit-code-from behave behave
- name: upload coverage reports
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: ./mrmap/acceptance-tests-coverage-report.xml
unit-tests:
name: unit-tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: pull needed docker images
run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml pull django-tests
- name: Run unit tests
run: |
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --abort-on-container-exit --exit-code-from django-tests django-tests
- name: upload coverage reports
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: ./backend/unit-tests-coverage-report.xml
sonar-scanner:
needs: [acceptance-tests, unit-tests]
name: sonar-scanner
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: pull needed docker images
run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml pull pre-commit-check
- name: download coverage reports
uses: actions/download-artifact@v2
with:
name: coverage-reports
path: ./mrmap
- name: Run sonar-scanner
run: |
echo -en "\n" >> ./mrmap/sonar-project.properties
echo "sonar.branch.name=$GITHUB_HEAD_REF" >> ./mrmap/sonar-project.properties
echo "sonar.branch.target=$GITHUB_BASE_REF" >> ./mrmap/sonar-project.properties
echo "sonar.login=${{ secrets.SONAR_TOKEN }}" >> ./mrmap/sonar-project.properties
cat ./mrmap/sonar-project.properties
ls ./mrmap
GITHUB_TOKEN='${{ secrets.GITHUB_TOKEN }}' docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --abort-on-container-exit --exit-code-from sonar-scanner sonar-scanner