-
Notifications
You must be signed in to change notification settings - Fork 15
127 lines (114 loc) · 3.78 KB
/
test.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
name: Test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
# Trigger on pull requests.
pull_request:
# Trigger on pushes to the mainline branches. This prevents building commits twice when the pull
# request source branch is in the same repository.
push:
branches:
- "trunk"
- "trunk-major"
# Trigger on request.
workflow_dispatch:
# Weekly builds on the trunk branch to check that the examples continue to work with the latest
# development version of HOOMD.
schedule:
- cron: '0 18 * * 1'
jobs:
start_action_runners:
name: Start action runners
runs-on: ubuntu-latest
steps:
- name: "Use jetstream2-admin/start"
uses: glotzerlab/jetstream2-admin/[email protected]
with:
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
number: 1
execute_notebooks:
name: Execute notebooks
runs-on: [self-hosted,jetstream2,CPU]
container:
image: glotzerlab/software:nompi
options: -u 0
steps:
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
# build the HOOMD trunk-minor branch to test the tutorials on the latest version
- name: Checkout
uses: actions/[email protected]
with:
path: hoomd
ref: trunk-major
repository: glotzerlab/hoomd-blue
submodules: true
- name: Make build directory
run: mkdir build
working-directory: hoomd
- name: Configure
run: >-
cmake
-DCMAKE_BUILD_TYPE=Release
-DENABLE_GPU=off
-DENABLE_MPI=off
-DENABLE_TBB=off
-DBUILD_TESTING=off
-DENABLE_LLVM=on
../
working-directory: hoomd/build
- name: Compile
run: make -j $(($(getconf _NPROCESSORS_ONLN) + 2))
working-directory: hoomd/build
- name: Display hoomd version
run: python3 -c "import hoomd; print(hoomd.version.version, hoomd.version.git_sha1)"
env:
PYTHONPATH: ${{ github.workspace }}/hoomd/build
# clone the tutorials and run them
- name: Checkout
uses: actions/[email protected]
with:
path: notebooks
- name: List notebooks
run: ls **/*.ipynb
working-directory: notebooks
- name: Execute notebooks
run: 'for i in */; do echo "Running notebooks in: $i" && jupyter nbconvert --execute --inplace $i/*.ipynb || exit 1; done'
working-directory: notebooks
env:
PYTHONPATH: ${{ github.workspace }}/hoomd/build
# This check is very basic, but we don't want to use `python -W error` as it will also catch any
# warnings generated inside nbconvert and its dependencies.
- name: Check for warnings
run: |
has_warnings=0
for file in **/*.ipynb
do
grep Warning $file && echo "::error file=${file}::Has deprecation warnings" && has_warnings=1
done
exit ${has_warnings}
working-directory: notebooks
# notify developers if the scheduled check fails
- name: Slack notification
if: ${{ github.event_name == 'schedule' && (failure() || cancelled()) }}
uses: 8398a7/[email protected]
with:
status: ${{ job.status }}
fields: workflow,job,message,commit
mention: channel
if_mention: failure,cancelled
channel: '#dev-hoomd-notifications'
username: Github Action
author_name: ''
job_name: Execute notebooks
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash