-
Notifications
You must be signed in to change notification settings - Fork 4
239 lines (228 loc) · 7.21 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
230
231
232
233
234
235
236
237
238
239
name: CI
on:
push:
branches: [ master, dev ]
pull_request:
branches:
- '**'
schedule:
- cron: '0 0 * * 0'
jobs:
docker-build:
name: Docker Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Push to DockerHub
uses: docker/build-push-action@v1
with:
push: true
tags: GITHUB_ACTION_${{ github.run_number }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: mmore500/conduit
add_git_labels: true
tidy:
name: Tidy
runs-on: ubuntu-20.04
needs:
- docker-build
container:
image: mmore500/conduit:GITHUB_ACTION_${{ github.run_number }}
# github actions requires root to access mounted volumes
options: --user root
steps:
- run: /opt/conduit/conduitpylib/test/run_tests.sh
- run: |
cd /opt/conduit
./ci/test_tidy.sh
binder:
name: Notebooks
runs-on: ubuntu-20.04
container:
image: mmore500/conduit:GITHUB_ACTION_684
# github actions requires root to access mounted volumes
options: --user root
steps:
- uses: actions/checkout@v2
# with:
# submodules: 'recursive'
# Adapted from https://askubuntu.com/a/524368
# - run: cd binder && ./execute_notebooks.sh
# adapted from https://unix.stackexchange.com/a/545630
- run: find -type f -name "*.pdf" -exec bash -c 'gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -dQUIET -sOutputFile="new.pdf" "{}"; rm "{}"; mv "new.pdf" "{}";' {} \;
- run: git config --global --add safe.directory /
- run: git init
- uses: fregante/setup-git-user@v1
- run: git commit --allow-empty -m "Initial commit"
- uses: JamesIves/[email protected]
with:
folder: .
branch: binder # The branch the action should deploy to.
unit:
name: Unit Tests
runs-on: ubuntu-20.04
needs:
- docker-build
strategy:
matrix:
mpicxx: [mpich, openmpi]
mode: [ Debug, Opt ]
fail-fast: false
container:
image: mmore500/conduit:GITHUB_ACTION_${{ github.run_number }}
# github actions requires root to access mounted volumes
options: --user=user --cap-add=SYS_ADMIN
env:
DISH_MPICXX: mpicxx.${{ matrix.mpicxx }}
OMPI_CXX: clang++
steps:
# undo github actions override of HOME to "/home/github/"
- run: |
export HOME="/home/user/"
cd /opt/conduit/
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.mode }} -DMPI_EXECUTABLE_SUFFIX=.${{ matrix.mpicxx }}
cmake --build build
cd build
ctest
coverage:
name: Coverage
runs-on: ubuntu-20.04
needs:
- docker-build
container:
image: mmore500/conduit:GITHUB_ACTION_${{ github.run_number }}
# github actions requires root to access mounted volumes
options: --cap-add=SYS_ADMIN
env:
DISH_MPICXX: mpicxx.openmpi
OMPI_CXX: clang++
CC: clang
CXX: clang++
# env variables listed in https://codecov.io/env
GITHUB_HEAD_REF: ${{ github.head_ref }}
GITHUB_REF: ${{ github.ref }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_WORKFLOW: ${{ github.workflow }}
steps:
- run: |
cd /opt/conduit/
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=ON
cmake --build build --target ccov-show-test-netuit
cmake --build build --target ccov-show-test-uit
cmake --build build --target ccov-show-test-uitsl
# adapted from https://docs.codecov.com/docs/codecov-uploader
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${{ secrets.CODECOV_TOKEN }}
# @MAM 10-2021: running manually because
# codecov/codecov-action@v1 and @v2 don't work
# due to permissions errors
microbenchmarks:
name: Microbenchmarks
runs-on: ubuntu-20.04
needs:
- docker-build
container:
image: mmore500/conduit:GITHUB_ACTION_${{ github.run_number }}
# github actions requires root to access mounted volumes
options: --cap-add=SYS_ADMIN
env:
OSF_USERNAME: ${{ secrets.OSF_USERNAME }}
OSF_PASSWORD: ${{ secrets.OSF_PASSWORD }}
CONTEXT: actions
steps:
- run: |
cd /opt/conduit/microbenchmarks
make
macrobenchmarks:
name: Macrobenchmarks
runs-on: ubuntu-20.04
needs:
- docker-build
container:
image: mmore500/conduit:GITHUB_ACTION_${{ github.run_number }}
# github actions requires root to access mounted volumes
options: --cap-add=SYS_ADMIN
env:
OSF_USERNAME: ${{ secrets.OSF_USERNAME }}
OSF_PASSWORD: ${{ secrets.OSF_PASSWORD }}
CONTEXT: actions
steps:
- run: |
cd /opt/conduit/macrobenchmarks
make
docs:
name: Source, Docs, Demos
runs-on: ubuntu-20.04
needs:
- docker-build
container:
image: mmore500/conduit:GITHUB_ACTION_${{ github.run_number }}
# github actions requires root to access mounted volumes
options: --cap-add=SYS_ADMIN
steps:
# undo github actions override of HOME to "/home/github/"
- run: |
export HOME="/home/user/"
cd /opt/conduit
make test-source
make docs
make demos
deploy-pages:
name: Deploy to GitHub Pages
runs-on: ubuntu-20.04
container:
image: mmore500/conduit:GITHUB_ACTION_${{ github.run_number }}
env:
OSF_PASSWORD: ${{ secrets.OSF_PASSWORD }}
OSF_USERNAME: ${{ secrets.OSF_USERNAME }}
# github actions requires root to access mounted volumes
options: --user root
if: github.ref == 'refs/heads/master'
needs:
- binder
- coverage
- docs
- macrobenchmarks
- microbenchmarks
- tidy
- unit
steps:
- run: make -C /opt/conduit/ web
- run: cp -r /opt/conduit/web/ web/
- uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: web # The folder the action should deploy.
CLEAN: true # Automatically remove deleted files from the deploy branch
deploy-dockerhub:
name: Deploy to Dockerhub
runs-on: ubuntu-20.04
needs:
- binder
- coverage
- docs
- macrobenchmarks
- microbenchmarks
- tidy
- unit
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Push to DockerHub
uses: docker/build-push-action@v1
with:
push: true
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: mmore500/conduit
tag_with_ref: true
tag_with_sha: true