forked from nlohmann/json
-
Notifications
You must be signed in to change notification settings - Fork 6
165 lines (144 loc) · 5.28 KB
/
parent-workflow.yml
File metadata and controls
165 lines (144 loc) · 5.28 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Parent Workflow
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # Runs daily at midnight UTC
permissions:
contents: read
jobs:
labeler:
permissions:
contents: read
pages: write
pull-requests: write
name: Run Labeler Workflow
uses: ./.github/workflows/labeler.yml
with:
artifact_id: "labeler-${{ github.sha }}"
SME_review_checker:
permissions:
contents: read
pull-requests: read
name: Run SME_review_checker Workflow
if: ${{ github.event_name == 'pull_request' }} # only run SME_review_checker for PRs
uses: ./.github/workflows/SME_review_checker.yml
with:
artifact_id: "SME_review_checker-${{ github.sha }}"
check_amalgamation:
name: Run Amalgamation Workflow
if: ${{ github.event_name == 'pull_request' }} # only run check_amalgamation for PRs
uses: ./.github/workflows/check_amalgamation.yml
with:
artifact_id: "check_amalgamation-${{ github.sha }}"
test_trudag_extensions:
name: Run Test Trudag Extensions Workflow
uses: ./.github/workflows/test_trudag_extensions.yml
with:
artifact_id: "test_trudag_extensions-${{ github.sha }}"
codeql:
permissions:
contents: read
security-events: write
name: Run Codeql analysis Workflow
uses: ./.github/workflows/codeql-analysis.yml
with:
artifact_id: "codeql-${{ github.sha }}"
ubuntu:
name: Run Ubuntu Workflow
permissions:
contents: write
needs: [codeql] # Error if CodeQL and Ubuntu triggered at the same time due to conflicting priorities
uses: ./.github/workflows/ubuntu.yml
with:
artifact_id: "ubuntu-${{ github.sha }}"
dependency_review:
name: Run dependency_review Workflow
if: ${{ github.event_name == 'pull_request' }} # only run dependency_review for PRs
uses: ./.github/workflows/dependency-review.yml
with:
artifact_id: "dependency_review-${{ github.sha }}"
collect_artifacts_pr:
name: "Collect Results & Deploy (PR)"
if: github.event_name == 'pull_request'
needs: [labeler, SME_review_checker, check_amalgamation, test_trudag_extensions, dependency_review, codeql, ubuntu]
runs-on: ubuntu-latest
strategy:
matrix:
target: [labeler, SME_review_checker, check_amalgamation, test_trudag_extensions, dependency_review, codeql, ubuntu]
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check child workflow results
run: |
echo "=== Checking Child Workflow Results ==="
result="${{ needs[matrix.target].result }}"
echo "${{ matrix.target }} workflow result: $result"
if [[ "$result" != "success" ]]; then
echo "❌ ${{ matrix.target }} workflow failed! Exiting..."
exit 1
fi
echo "✅ Child workflows completed successfully!"
env:
current_workflow: ${{ matrix.target }}
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: "${{ matrix.target }}-${{ github.sha }}"
path: artifacts/
collect_artifacts_non_pr:
name: "Collect Results & Deploy (Non-PR)"
if: github.event_name != 'pull_request'
needs: [labeler, test_trudag_extensions, codeql, ubuntu] # no check_amalgamation, dependency_review or SME_review_checker if non PR
runs-on: ubuntu-latest
strategy:
matrix:
target: [labeler, test_trudag_extensions, codeql, ubuntu]
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check child workflow results
run: |
echo "=== Checking Child Workflow Results ==="
result="${{ needs[matrix.target].result }}"
echo "${{ matrix.target }} workflow result: $result"
if [[ "$result" != "success" ]]; then
echo "❌ ${{ matrix.target }} workflow failed! Exiting..."
exit 1
fi
echo "✅ Child workflows completed successfully!"
env:
current_workflow: ${{ matrix.target }}
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: "${{ matrix.target }}-${{ github.sha }}"
path: artifacts/
test_publish_documentation:
permissions:
contents: write
pages: write
pull-requests: write
id-token: write
security-events: read
name: Test publish_documentation Workflow
if: github.event_name == 'pull_request' # Whenever on Pull-request, test publication
needs: [collect_artifacts_pr]
uses: ./.github/workflows/test_publication.yml
with:
artifact_id: "ubuntu-${{ github.sha }}"
publish_documentation:
permissions:
contents: write
pages: write
pull-requests: write
id-token: write
security-events: read
name: Run publish_documentation Workflow
if: github.event_name == 'push' # Publish documentation should only run on push to main
needs: [collect_artifacts_non_pr]
uses: ./.github/workflows/publish_documentation.yml
with:
artifact_id: "ubuntu-${{ github.sha }}"