-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (69 loc) · 2.2 KB
/
quality.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
name: Quality Tests
on: pull_request
jobs:
changes:
name: Check changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
docs: ${{ steps.filter.outputs.docs }}
email_templates: ${{ steps.filter.outputs.email_templates }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
backend:
- 'backend/**'
frontend:
- 'frontend/**'
docs:
- 'docs/**'
email_templates:
- 'email-templates-generator/**'
backend:
name: Back End Quality
needs: changes
if: ${{ needs.changes.outputs.backend == 'true' }}
uses: ./.github/workflows/quality-backend.yml
secrets: inherit
frontend:
name: Front End Quality
needs: changes
if: ${{ needs.changes.outputs.frontend == 'true' }}
uses: ./.github/workflows/quality-frontend.yml
secrets: inherit
email_templates:
name: Email Templates Quality
needs: changes
if: ${{ needs.changes.outputs.email_templates == 'true' }}
uses: ./.github/workflows/quality-email-templates.yml
secrets: inherit
docs:
name: Docs Quality
needs: changes
if: ${{ needs.changes.outputs.docs == 'true' }}
uses: ./.github/workflows/quality-docs.yml
secrets: inherit
final-check:
name: Final Check
needs: [backend, frontend, docs, email_templates]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check previous jobs status
run: |
status=$(echo "${{ needs.backend.result }}" | tr '[:upper:]' '[:lower:]')
status+=$(echo " ${{ needs.frontend.result }}" | tr '[:upper:]' '[:lower:]')
status+=$(echo " ${{ needs.docs.result }}" | tr '[:upper:]' '[:lower:]')
status+=$(echo " ${{ needs.email_templates.result }}" | tr '[:upper:]' '[:lower:]')
if [[ "$status" == *"failure"* ]]; then
echo "One or more previous jobs failed."
exit 1
else
echo "All previous jobs succeeded or were skipped."
exit 0
fi