forked from ExtremeFLOW/neko
-
Notifications
You must be signed in to change notification settings - Fork 0
196 lines (167 loc) · 5.28 KB
/
Copy pathdevelop.yml
File metadata and controls
196 lines (167 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
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
name: develop
# Controls when the action will run.
on:
pull_request:
branches: [develop, release/*, master]
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch:
#merge queue trigger
merge_group:
types:
- checks_requested
env:
PFUNIT_VERSION: v4.15.0
JSON_FORTRAN_VERSION: 8.4.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
# ========================================================================== #
# Style and linting checks
linting:
name: Linting
needs: prepare
uses: ./.github/workflows/check_lint.yml
formatting:
name: Formatting
needs: prepare
uses: ./.github/workflows/check_format.yml
depend:
name: Check .depend file
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:
if: ${{ github.event_name != 'pull_request' }}
name: Nvidia
needs:
- prepare
- depend
uses: ./.github/workflows/check_nvidia.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
# ========================================================================== #
# Regression checks
Valgrind:
name: Valgrind
needs:
- prepare
- depend
uses: ./.github/workflows/check_valgrind.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
# ========================================================================== #
# Determine if the PR is ready
check_complete:
name: Develop PR Ready
if: ${{ always() }}
needs:
- prepare
- linting
- formatting
- depend
- GNU
- Intel
- Valgrind
- Nvidia
runs-on: ubuntu-latest
env:
draft_status: ${{ needs.prepare.result }}
flint_status: ${{ needs.linting.result }}
format_status: ${{ needs.formatting.result }}
gnu_status: ${{ needs.GNU.result }}
intel_status: ${{ needs.Intel.result }}
valgrind_status: ${{ needs.Valgrind.result }}
nvidia_status: ${{ needs.Nvidia.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 [ "$format_status" != "success" ]; then
fail+=("\t- Formatting check: $format_status")
success=false
fi
if [ "$gnu_status" != "success" ]; then
fail+=("\t- GNU check: $gnu_status")
success=false
fi
if [ "$intel_status" != "success" ]; then
fail+=("\t- Intel check: $intel_status")
success=false
fi
# Valgrind check is informational only.
if [ "$valgrind_status" != "success" ]; then
fail+=("\t- Valgrind check: $valgrind_status (informational only)")
fi
# NVidia check is skipped since the compiler is broken.
# if [ "$nvidia_status" != "success" ]; then
# fail+=("\t- NVIDIA check: $nvidia_status")
# success=false
# fi
if [ ${#fail[@]} -ne 0 ]; then
>&2 echo "The following checks failed:"
for i in "${fail[@]}"; do
>&2 printf "$i\n"
done
fi
if [ "$success" = false ]; then
exit 1
fi
echo "All checks passed"