-
Notifications
You must be signed in to change notification settings - Fork 3.7k
115 lines (105 loc) · 3.23 KB
/
quality-checks.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
111
112
113
114
115
name: Quality checks
on:
pull_request:
branches: [release, master]
jobs:
path-filter:
runs-on: ubuntu-latest
outputs:
server: ${{ steps.filter.outputs.server }}
client: ${{ steps.filter.outputs.client == 'true' && steps.filter.outputs.not-cypress-manual == 'true' }}
steps:
# Check out merge commit with the base branch in case this workflow is invoked via pull request
- name: Checkout the merged commit from PR and base branch
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
server:
- 'app/server/**'
client:
- 'app/client/**'
not-cypress-manual:
- '!app/client/cypress/manual_TestSuite/**'
server-spotless:
name: server-spotless
needs: path-filter
if: needs.path-filter.outputs.server == 'true'
uses: ./.github/workflows/server-spotless.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
server-unit-tests:
name: server-unit-tests
needs: path-filter
if: needs.path-filter.outputs.server == 'true'
uses: ./.github/workflows/server-build.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
client-build:
name: client-build
needs: path-filter
if: needs.path-filter.outputs.client == 'true'
uses: ./.github/workflows/client-build.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
client-prettier:
name: client-prettier
needs: path-filter
if: needs.path-filter.outputs.client == 'true'
uses: ./.github/workflows/client-prettier.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
client-unit-tests:
name: client-unit-tests
needs: path-filter
if: needs.path-filter.outputs.client == 'true'
uses: ./.github/workflows/client-unit-tests.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
client-lint:
name: client-lint
needs: path-filter
if: needs.path-filter.outputs.client == 'true'
uses: ./.github/workflows/client-lint.yml
secrets: inherit
with:
pr: ${{ github.event.pull_request.number }}
qc-result:
name: qc-result
needs:
[
server-spotless,
server-unit-tests,
client-build,
client-prettier,
client-unit-tests,
client-lint,
]
if: always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Return status for quality checks
run: |
if [[ "${{ needs.server-spotless.result }}" == "failure" || \
"${{ needs.server-unit-tests.result }}" == "failure" || \
"${{ needs.client-build.result }}" == "failure" || \
"${{ needs.client-prettier.result }}" == "failure" || \
"${{ needs.client-unit-tests.result }}" == "failure" || \
"${{ needs.client-lint.result }}" == "failure" ]]; then
echo "Quality checks failed";
exit 1;
else
echo "Quality checks successful";
exit 0;
fi