-
Notifications
You must be signed in to change notification settings - Fork 32
211 lines (186 loc) · 5.63 KB
/
main.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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: CI
# Controls when the action will run.
on:
pull_request:
branches: [master]
workflow_dispatch:
env:
PFUNIT_VERSION: v4.4.2
JSON_FORTRAN_VERSION: 8.3.0
# Allow only one concurrent deployment, skipping runs queued between the run
# in-progress and latest queued. We do not wish to waste time on old runs if a
# newer one is available.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
prepare:
name: Prepare the environment
runs-on: ubuntu-latest
outputs:
pfunit-version: ${{ steps.store.outputs.pfunit-version }}
json-fortran-version: ${{ steps.store.outputs.json-fortran-version }}
steps:
- name: Check if PR is a draft
shell: bash
run: |
if [ "${{ github.event.pull_request.draft }}" == "true" ]; then
echo "PR is a draft" >&2
exit 1
fi
- name: Store environment variables
id: store
run: |
echo "flint-global-minimum=$FLINT_GLOBAL_MINIMUM" >> $GITHUB_OUTPUT
echo "flint-changed-minimum=$FLINT_CHANGED_FILES_MINIMUM" >> $GITHUB_OUTPUT
echo "pfunit-version=$PFUNIT_VERSION" >> $GITHUB_OUTPUT
echo "json-fortran-version=$JSON_FORTRAN_VERSION" >> $GITHUB_OUTPUT
linting:
name: Flint
needs:
- prepare
uses: ./.github/workflows/check_lint.yml
depend:
name: Make depend
needs:
- prepare
uses: ./.github/workflows/check_depend.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
# ========================================================================== #
# Compilation checks
GNU:
name: GNU
needs:
- prepare
- depend
uses: ./.github/workflows/check_gnu.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
pfunit-version: ${{ needs.prepare.outputs.pfunit-version }}
Intel:
name: Intel
needs:
- prepare
- depend
uses: ./.github/workflows/check_intel.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
Nvidia:
name: Nvidia
needs:
- prepare
- depend
uses: ./.github/workflows/check_nvidia.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
# ========================================================================== #
# ReFrame and benchmarks
ReFrame:
name: ReFrame
needs:
- prepare
- depend
- GNU
uses: ./.github/workflows/check_reframe.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
# ========================================================================== #
# Documentation
Documentation:
name: documentation
needs:
- prepare
- depend
- GNU
- Intel
# - Nvidia
- ReFrame
uses: ./.github/workflows/documentation.yml
# # ========================================================================== #
# # Upload the badges
# upload-badges:
# name: "Upload badges"
# runs-on: ubuntu-20.04
# needs:
# - linting
# if: ${{ !cancelled() }} &&
# ${{ needs.linting.result == 'success' }} &&
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# pattern: "*-badge"
# path: doc/media/
# merge-multiple: true
# - name: Push badges
# uses: EndBug/add-and-commit@v9
# with:
# add: "doc/media/*-badge.svg"
# message: "Add badges"
# author_name: "GitHub Actions"
# default_author: github_actor
check_complete:
name: Release PR Ready
if: ${{ always() }}
needs:
- prepare
- linting
- depend
- GNU
- Intel
- Nvidia
- ReFrame
- documentation
runs-on: ubuntu-latest
env:
draft_status: ${{ needs.prepare.result }}
flint_status: ${{ needs.linting.result }}
gnu_status: ${{ needs.GNU.result }}
inel_status: ${{ needs.Intel.result }}
nvidia_status: ${{ needs.Nvidia.result }}
reframe_status: ${{ needs.ReFrame.result }}
doc_status: ${{ needs.documentation.result }}
steps:
- name: All checks passed
run: |
success=true
fail=()
if [ "$draft_status" != "success" ]; then
fail+=("\t- Draft check: $draft_status")
success=false
fi
if [ "$flint_status" != "success" ]; then
fail+=("\t- Linting check: $flint_status")
success=false
fi
if [ "$gnu_status" != "success" ]; then
fail+=("\t- GNU check: $gnu_status")
success=false
fi
if [ "$inel_status" != "success" ]; then
fail+=("\t- Intel check: $inel_status")
success=false
fi
if [ "$nvidia_status" != "success" ]; then
fail+=("\t- NVIDIA check: $nvidia_status")
success=false
fi
if [ "$reframe_status" != "success" ]; then
fail+=("\t- ReFrame check: $reframe_status")
success=false
fi
if [ "$doc_status" != "success" ]; then
fail+=("\t- Documentation check: $doc_status")
success=false
fi
if [ "$success" = false ]; then
>&2 echo "The following checks failed:"
for i in "${fail[@]}"; do
>&2 printf "$i\n"
done
exit 1
fi
echo "All checks passed"