-
Notifications
You must be signed in to change notification settings - Fork 3
177 lines (150 loc) · 4.97 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
# SPDX-FileCopyrightText: 2022 Dennis Gläser <dennis.glaeser@iws.uni-stuttgart.de>
# SPDX-License-Identifier: MIT
name: test-suite
on:
push:
branches: [main]
pull_request:
branches:
- main
- 'releases/**'
paths-ignore:
- 'docker/**'
schedule:
- cron: '30 22 * * 0,3'
workflow_dispatch:
workflow_call:
env:
DEFAULT_COMPILER_PKG: g++-12
DEFAULT_C_COMPILER: gcc-12
DEFAULT_CXX_COMPILER: g++-12
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
jobs:
test-compilers:
runs-on: ubuntu-22.04
container: dglaeser/gridformat-action-images:full
strategy:
matrix:
compiler_pkg: [g++-12, clang-16]
include:
- c_compiler: gcc-12
compiler_pkg: g++-12
- cxx_compiler: g++-12
compiler_pkg: g++-12
- c_compiler: clang-16
compiler_pkg: clang-16
- cxx_compiler: clang++-16
compiler_pkg: clang-16
steps:
- name: checkout-repository
uses: actions/checkout@v4
with:
submodules: true
- name: check-reuse-compliance
uses: fsfe/reuse-action@v2
- name: Check CITATION.cff validity
uses: citation-file-format/cffconvert-github-action@2.0.0
with:
args: "--validate"
- name: configure
run: |
rm -rf build
cmake -DCMAKE_C_COMPILER=${{matrix.c_compiler}} \
-DCMAKE_CXX_COMPILER=${{matrix.cxx_compiler}} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=/gfmt-dependencies \
-DGRIDFORMAT_BUILD_BINARIES=ON \
-DGRIDFORMAT_BUILD_TESTS=ON \
-B build | tee gfmt_cmake_log.txt
- name: set-git-variables
uses: ./.github/actions/set-git-variables
- name: set-test-commands
uses: ./.github/actions/set-test-commands
with:
build_directory: build
source_tree: ${{ env.GFMT_SOURCE_TREE }}
target_tree: main
- name: check-documentation-code
run: |
python3 test/test_readme_quick_start.py \
-r $GFMT_TREE \
-e "-DCMAKE_C_COMPILER=/usr/bin/gcc-12 -DCMAKE_CXX_COMPILER=/usr/bin/g++-12" \
-o "${GFMT_ORIGIN}"
python3 test/test_readme_tested_versions.py --cmake-log-file gfmt_cmake_log.txt
shell: bash
- name: build-binaries
run: cmake --build build
- name: build-tests
run: pushd build && $(echo "$GFMT_BUILD_CMD") && popd
shell: bash
- name: test
run: |
if [[ ${{ github.ref_name }} != "main" ]]; then
echo "Regression-testing sample files only for branch ${{ github.ref_name }}"
export GRIDFORMAT_REGRESSION_SAMPLES_ONLY=true
fi
pushd build && $(echo "$GFMT_TEST_CMD") && popd
shell: bash
- name: verify-no-skipped-tests
run: |
if [[ -e build/Testing/Temporary/LastTestsDisabled.log ]]; then
echo "The full test suite should not skip any tests. Making the job fail..."
exit 1
else
echo "No skipped tests detected"
fi
shell: bash
mem-check:
runs-on: ubuntu-22.04
container: dglaeser/gridformat-action-images:full
steps:
- name: checkout-repository
uses: actions/checkout@v2
with:
submodules: true
- name: configure
run: |
rm -rf build
cmake -DCMAKE_C_COMPILER=/usr/bin/$DEFAULT_C_COMPILER \
-DCMAKE_CXX_COMPILER=/usr/bin/$DEFAULT_CXX_COMPILER \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_PREFIX_PATH=/gfmt-dependencies \
-DGRIDFORMAT_BUILD_TESTS=ON \
-B build
- name: set-git-variables
uses: ./.github/actions/set-git-variables
- name: set-test-commands
uses: ./.github/actions/set-test-commands
with:
build_directory: build
source_tree: ${{ env.GFMT_SOURCE_TREE }}
target_tree: main
- name: run-memcheck
run: cd build && $(echo "$GFMT_MEMCHECK_CMD")
test-full-installation:
runs-on: ubuntu-22.04
container: dglaeser/gridformat-action-images:full
steps:
- name: checkout-repository
uses: actions/checkout@v2
with:
submodules: true
- name: test-installed-package
uses: ./.github/actions/test-installed-pkg
with:
c_compiler: /usr/bin/$DEFAULT_C_COMPILER
cxx_compiler: /usr/bin/$DEFAULT_CXX_COMPILER
test-minimal-installation:
runs-on: ubuntu-22.04
container: dglaeser/gridformat-action-images:minimal
steps:
- name: checkout-repository
uses: actions/checkout@v2
with:
submodules: false
- name: test-installed-package
uses: ./.github/actions/test-installed-pkg
with:
c_compiler: /usr/bin/$DEFAULT_C_COMPILER
cxx_compiler: /usr/bin/$DEFAULT_CXX_COMPILER