-
Notifications
You must be signed in to change notification settings - Fork 69
151 lines (129 loc) · 4.82 KB
/
Copy pathci.yml
File metadata and controls
151 lines (129 loc) · 4.82 KB
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
name: ERF CI
on:
push:
# branches: [development]
paths-ignore:
- Docs
- README.rst
- license.txt
pull_request:
branches: [development]
concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-ci
cancel-in-progress: true
jobs:
Build-And-Test:
runs-on: ${{matrix.os}}
name: OS ${{matrix.os}} - Particles ${{matrix.particles}}
strategy:
matrix:
os: [ubuntu-22.04]
particles: [OFF, ON]
include:
- os: ubuntu-22.04
install_deps: sudo apt-get install mpich libmpich-dev
comp: gnu
procs: $(nproc)
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Free disk space on Ubuntu
uses: ./.github/actions/free-space-ubuntu
- name: Setup
run: |
# echo "::add-matcher::.github/problem-matchers/gcc.json"
echo "NPROCS=${{matrix.procs}}" >> $GITHUB_ENV
# cmake -E make_directory ${{runner.workspace}}/deps
- name: Handle Dependencies
run: |
# Install MPI
${{matrix.install_deps}}
- name: Install CCache
run: Submodules/AMReX/.github/workflows/dependencies/dependencies_ccache.sh
- name: Set Up Cache
uses: actions/cache@v5
with:
path: ~/.cache/ccache
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
restore-keys: |
ccache-${{ github.workflow }}-${{ github.job }}-git-
- name: Configure CMake
run: |
cmake \
-B${{runner.workspace}}/ERF/build-${{matrix.os}} \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/ERF/install \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DERF_DIM:STRING=3 \
-DERF_ENABLE_MPI:BOOL=ON \
-DERF_PARALLEL_TEST_ALLOW_OVERSUBSCRIBE:BOOL=ON \
'-DERF_PARALLEL_TEST_NRANKS:STRING=1;2;4' \
-DERF_ENABLE_PARTICLES:BOOL=${{matrix.particles}} \
-DERF_ENABLE_TESTS:BOOL=ON \
-DERF_ENABLE_ALL_WARNINGS:BOOL=ON \
-DERF_ENABLE_FCOMPARE:BOOL=ON \
${{github.workspace}};
# ${{matrix.mpipreflags}} \
# -DCODECOVERAGE:BOOL=ON \
- name: Build
run: |
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=600M
ccache -z
cmake \
--build ${{runner.workspace}}/ERF/build-${{matrix.os}} \
--parallel ${{env.NPROCS}} \
2>&1 | tee -a ${{runner.workspace}}/build-output.txt;
ccache -s
du -hs ~/.cache/ccache
- name: Report
run: |
grep -Ei "warning:|error:" ${{runner.workspace}}/build-output.txt \
| grep -Ev "Submodules/(amrex|googletest)" | grep -Ev "lto-wrapper: warning:" | sort | uniq \
| awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > ${{runner.workspace}}/build-output-warnings.txt
cat ${{runner.workspace}}/build-output-warnings.txt
export return=$(tail -n 1 ${{runner.workspace}}/build-output-warnings.txt | awk '{print $2}')
exit ${return}
- name: Check Unit Test Registration
run: |
Tests/Unit/erf_unit_tests --gtest_list_tests | tee ${{runner.workspace}}/unit-test-list.txt
grep -Eq '^[A-Za-z0-9_].*\.$' ${{runner.workspace}}/unit-test-list.txt
working-directory: ${{runner.workspace}}/ERF/build-${{matrix.os}}
- name: Run Serial Unit Tests
run: |
ctest -L unit --output-on-failure --no-tests=error
working-directory: ${{runner.workspace}}/ERF/build-${{matrix.os}}
- name: Run Parallel Tests
run: |
ctest -L parallel --output-on-failure --no-tests=error
working-directory: ${{runner.workspace}}/ERF/build-${{matrix.os}}
- name: Regression Tests
run: |
ctest -L regression -VV
working-directory: ${{runner.workspace}}/ERF/build-${{matrix.os}}
# Raf: disabled Codecov since the dashboard and GitHub comments were buggy,
# but it may be useful to post the gcov coverage reports to GitHub Actions
# artifacts.
# Note: if reenabling Codecov, the reports must be in xml format not html.
# - name: Generate coverage report
# working-directory: ${{runner.workspace}}/ERF/build-${{matrix.os}}
# run: |
# find . -type f -name '*.gcno' -path "**Source**" -exec gcov -pb {} +
# cd ..
# gcovr -g -k -r . --xml regressioncov.html # -v
# - name: Success artifacts
# uses: actions/upload-artifact@v4
# if: success()
# with:
# name: build-and-test
# path: |
# ${{runner.workspace}}/ERF/regressioncov.html
# - name: Failing test artifacts
# uses: actions/upload-artifact@v4
# if: failure()
# with:
# name: build-and-test
# path: |
# ${{runner.workspace}}/ERF/regressioncov.html