-
Notifications
You must be signed in to change notification settings - Fork 12
191 lines (160 loc) · 5.12 KB
/
main-app.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
name: Main application
on:
push:
branches:
- main
paths:
- Code/**
- dependencies/**
pull_request:
schedule:
# Run every Monday 0700 UTC
- cron: '0 7 * * 1'
workflow_dispatch:
# Run on demand
inputs:
run_long_tests:
required: true
default: 'true'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: RelWithDebInfo
deps_install_prefix: ${{github.workspace}}/deps-install
hemelb_install_prefix: ${{github.workspace}}/install
# VMs have 2 cores, double as compilation often IO bound
CMAKE_BUILD_PARALLEL_LEVEL: 4
jobs:
basic-checks:
name: Basic code quality checks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Check copyright statements
run: python Scripts/checkCopyright.py
- name: Check C++ include guards
run: python Scripts/check_once_guards.py
fluid_only_build:
name: Build in fluid-only mode
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [gnu-11, gnu-12, gnu-13, llvm-15]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-compilers
with:
compiler: ${{ matrix.compiler }}
- uses: ./.github/actions/install-hemelb-deps
with:
name: fluidonly
- name: Code configure
run: >-
cmake
-S ${{github.workspace}}/.github/workflows/testcpp
-B ${{github.workspace}}/build-testcpp
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
working-directory: ${{github.workspace}}/build-testcpp
run: |
cmake --build .
- name: Code make build dir
run: mkdir -p ${{github.workspace}}/build
- name: Code configure
run: >-
cmake
-S ${{github.workspace}}/Code
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DCMAKE_INSTALL_PREFIX:STRING=${{env.hemelb_install_prefix}}
-DHEMELB_DEPENDENCIES_INSTALL_PREFIX:STRING=${{env.deps_install_prefix}}
-DHEMELB_BUILD_RBC:BOOL=OFF
-DMPIEXEC_MAX_NUMPROCS:STRING=4
- name: Build and install HemeLB, adding install dir to PATH
working-directory: ${{github.workspace}}/build
run: |
cmake --build .
cmake --install .
echo "${hemelb_install_prefix}/bin" >> $GITHUB_PATH
- name: Run main unit tests
working-directory: ${{github.workspace}}/build
run: tests/hemelb-tests
- name: Store build tree on error
if: failure()
uses: actions/upload-artifact@v3
with:
name: fluid-only-failed-build-tree
path: build
- name: Get hemelb-tests repo
uses: ./.github/actions/get-tests-repo
with:
path: hemelb-tests
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Install python tools (required by diff test)
working-directory: python-tools
run: pip install .
- name: Run the simple regression test
working-directory: hemelb-tests/diffTest
env:
MPIRUN_FLAGS: --oversubscribe
NUMPROCS: 2
OFFSET_CHECK: light
run: ./diffTest.sh
- name: Store results on error
if: failure()
uses: actions/upload-artifact@v3
with:
name: fluid-only-failed-diffTest
path: hemelb-tests/diffTest/results
- name: Run the checkpoint test
working-directory: hemelb-tests/fluid-checkpoint
env:
MPIRUN_FLAGS: --oversubscribe
run: ./run.sh
- name: Store results on error
if: failure()
uses: actions/upload-artifact@v3
with:
name: fluid-only-failed-checkpointTest
path: hemelb-tests/fluid-checkpoint/results
rbc_build:
name: Build in RBC mode
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-hemelb-deps
with:
name: rbc
extra_apt: libhdf5-mpi-dev
extra_cmake: '-DHEMELB_BUILD_RBC:BOOL=ON'
- name: Code make build dir
run: mkdir -p ${{github.workspace}}/build
- name: Code configure
run: >-
cmake
-S ${{github.workspace}}/Code
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DHEMELB_DEPENDENCIES_INSTALL_PREFIX:STRING=${{env.deps_install_prefix}}
-DHEMELB_BUILD_RBC:BOOL=ON
-DMPIEXEC_MAX_NUMPROCS:STRING=4
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build .
- name: Run main unit tests
working-directory: ${{github.workspace}}/build
run: tests/hemelb-tests
- name: Run parallel RBC tests
working-directory: ${{github.workspace}}/build
run: mpirun --oversubscribe -np 4 tests/mpi_redblood_tests
- name: Run longer integration tests on schedule or request
if: github.event == 'scheduled' || (github.event == 'workflow_dispatch' && inputs.run_long_tests == 'true')
working-directory: ${{github.workspace}}/build
run: tests/hemelb-tests [long]
- name: Store build tree on error
if: failure()
uses: actions/upload-artifact@v3
with:
name: rbc-failed-build-tree
path: build