generated from feelpp/feelpp-project
-
Notifications
You must be signed in to change notification settings - Fork 0
229 lines (220 loc) · 6.86 KB
/
ci.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
name: CI
on:
push:
branches:
- '**' # Push events on all branches
paths-ignore:
- '.github/workflows/init.yml'
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 including semver
jobs:
build_wheel:
runs-on: self-ubuntu-22.04
name: Build wheel
if: "!contains(github.event.head_commit.message, 'wheel skip')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Virtual Environment
run: |
python3 -m venv .venv
source .venv/bin/activate
pip3 install -I -r requirements.txt
- name: Compile
run: |
pip3 wheel --no-deps --wheel-dir dist .
env:
CXX: clang++
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: wheel-artifacts
path: dist/*.whl
tests:
runs-on: self-ubuntu-22.04
name: Integration Tests
needs: build_wheel
if: "!contains(github.event.head_commit.message, 'tests skip')"
steps:
- uses: actions/checkout@v4
- name: Download packages
uses: actions/download-artifact@v3
with:
name: wheel-artifacts
path: dist/
- name: Install Python dependencies
run: |
python -m venv .venv
source .venv/bin/activate
pip3 install --upgrade pip
pip3 install -I -r requirements.txt
pip3 install dist/*.whl
- name: Unit tests
run: |
source .venv/bin/activate
python3 -m pytest
env:
GIRDER_API_KEY: ${{secrets.GIRDER}}
- name: Compile test applications
run: |
mpic++ -std=c++17 -O3 tests/data/parallelSum.cpp -o tests/data/parallelSum
- name: Test benchmarks
run: |
source .venv/bin/activate
execute-benchmark -mc config/machines/gaya_ci.json -bc config/tests_parallelSum/parallelSum.json -pc config/tests_parallelSum/plots.json
echo $?
- name: Dry-run reports
run: |
source .venv/bin/activate
render-benchmarks --config-file reports/website_config.json
- name: Check files
run: | #TODO: check if not empty (maybe)
nb_rfm_report_files=$(ls -1q reports/parallelSum/parallel_sum/gaya|wc -l)
nb_doc_reports=$(ls -1q docs/modules/ROOT/pages/reports/|wc -l)
if [ "$nb_rfm_report_files" -ne 1 ] || [ "$nb_doc_reports" -ne 1 ]; then
echo "Reports where not rendered."
exit 1
fi
docs:
runs-on: self-ubuntu-22.04
name: Build Antora Site
needs: build_wheel
if: "!contains(github.event.head_commit.message, 'docs skip')"
steps:
- uses: actions/checkout@v4
- name: Install credentials
run: echo https://$GITHUB_OAUTH:@github.com > $HOME/.git-credentials
env:
GITHUB_OAUTH: ${{ secrets.CR_PAT_WORKFLOW }}
- name: Install NPM dependencies
run: npm install
- name: Download
uses: actions/download-artifact@v3
with:
name: wheel-artifacts
path: dist/
- name: Install Python dependencies
run: |
python -m venv .venv
source .venv/bin/activate
pip3 install -I -r requirements.txt
pip3 install dist/*.whl
tree .venv
- name: Download website config
run: |
source .venv/bin/activate
source ./girder_deploy_config.sh
girder-download --girder_id=$production_website_config_id --output_dir=./tmp/ --filename=website_config.json
env:
GIRDER_API_KEY: ${{secrets.GIRDER}}
- name: Render reports
run: |
source .venv/bin/activate
render-benchmarks --config-file=./tmp/website_config.json
env:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
- name: Build Antora Site
run: |
source .venv/bin/activate
npm run antora
- name: Deploy
if: ${{ github.ref_name == 'master' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: public # The folder the action should deploy.
build_code:
runs-on: self-ubuntu-22.04
name: Build, Install, Package code
if: "!contains(github.event.head_commit.message, 'code skip')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
cmake --preset default
cmake --build --preset default
- name: Check
run: |
ctest --preset default
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
- name: Package
run: |
cmake --build --preset default -t package
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: benchmarking-artifacts
path: build/default/assets/benchmarking-*
deliver:
runs-on: self-ubuntu-22.04
needs: build_code
name: Build docker, tag and push
steps:
- uses: actions/checkout@v4
- name: Download
uses: actions/download-artifact@v3
with:
# Artifact name
name: benchmarking-artifacts
path: artifacts/
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/feelpp/benchmarking
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build container image
uses: docker/build-push-action@v6
with:
context: artifacts
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./Dockerfile
release:
runs-on: self-ubuntu-22.04
name: Release
needs: [build_wheel, build_code]
if: startsWith(github.ref ,'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Download Deb Packages
uses: actions/download-artifact@v3
with:
name: benchmarking-artifacts
path: artifacts/
- name: Download Wheel Packages
uses: actions/download-artifact@v3
with:
name: wheel-artifacts
path: dist/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/*.deb
dist/*.whl
draft: false
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')}}
name: Release ${{ github.ref_name }}
generate_release_notes: true
tag_name: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}