-
Notifications
You must be signed in to change notification settings - Fork 32
204 lines (182 loc) · 6.17 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
name: CI
# Controls when the action will run.
on:
pull_request:
branches: [master]
workflow_dispatch:
env:
FLINT_GLOBAL_MINIMUM: 9.0
FLINT_CHANGED_FILES_MINIMUM: 10.0
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:
flint-global-minimum: ${{ steps.store.outputs.flint-global-minimum }}
flint-changed-minimum: ${{ steps.store.outputs.flint-changed-minimum }}
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:
needs:
- prepare
uses: ./.github/workflows/check_lint.yml
with:
global-minimum-score: ${{ needs.prepare.outputs.flint-global-minimum }}
changed-files-minimum-score: ${{ needs.prepare.outputs.flint-changed-minimum }}
depend:
name: Make depend
needs:
- prepare
uses: ./.github/workflows/check_depend.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
GNU:
needs:
- prepare
uses: ./.github/workflows/check_gnu.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
pfunit-version: ${{ needs.prepare.outputs.pfunit-version }}
Intel:
needs:
- prepare
uses: ./.github/workflows/check_intel.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
NVIDIA:
needs:
- prepare
uses: ./.github/workflows/check_nvidia.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
ReFrame:
needs:
- prepare
- GNU
uses: ./.github/workflows/check_reframe.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}
documentation:
needs: [prepare, Intel, GNU, NVIDIA, ReFrame]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup env.
run: |
sudo apt-get update && sudo apt-get install -y git openmpi-bin libopenmpi-dev autoconf automake autotools-dev gfortran libopenblas-dev make git m4 python3 doxygen fonts-freefont-ttf graphviz
git clone https://github.com/ExtremeFLOW/doxygen-awesome-css doc/doxygen-awesome-css
- name: Get JSON-Fortran
id: get-json-fortran
uses: ./.github/actions/setup_json-fortran
with:
version: ${{ needs.prepare.outputs.json-fortran-version }}
os: ${{ runner.os }}
compiler: gfortran
- name: Add JSON-Fortran to environment
env:
JSON_FORTRAN_DIR: ${{ steps.get-json-fortran.outputs.install-dir }}
run: |
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:$JSON_FORTRAN_DIR/lib/pkgconfig/" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$JSON_FORTRAN_DIR/lib/" >> $GITHUB_ENV
- name: Doxygen
run: |
./regen.sh
./configure FC=gfortran
make html
# Deploy the HTML documentation to GitHub Pages
- name: GH Pages Deployment
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/html/
allow_empty_commit: false
force_orphan: true
publish_branch: gh-pages
destination_dir: docs/release
keep_files: true
enable_jekyll: true
check_complete:
name: Main 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"