-
-
Notifications
You must be signed in to change notification settings - Fork 2
134 lines (107 loc) · 2.93 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
name: ci
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
CTEST_NO_TESTS_ACTION: error
CMAKE_BUILD_PARALLEL_LEVEL: 4
CTEST_PARALLEL_LEVEL: 0
on:
push:
paths:
- "**.c"
- "**.cpp"
- "**.f90"
- "**.F90"
- "**/CMakeLists.txt"
- "**.cmake"
- ".github/workflows/ci.yml"
- "!memcheck.cmake"
- "!coverage.cmake"
jobs:
core:
timeout-minutes: 15
strategy:
matrix:
os: [ubuntu-latest]
shared: [true, false]
gcc: [9, 10, 11, 12, 13]
mpi: [openmpi]
include:
- os: macos-latest
mpi: openmpi
gcc: 13
- os: ubuntu-latest
mpi: mpich
gcc: 13
runs-on: ${{ matrix.os }}
env:
CC: gcc-${{ matrix.gcc }}
FC: gfortran-${{ matrix.gcc }}
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Python pkgs
run: pip install numpy h5py
- name: install HDF5-${{ matrix.mpi }} (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install --no-install-recommends ninja-build libhdf5-${{ matrix.mpi }}-dev hdf5-tools lib${{ matrix.mpi }}-dev
- name: Install HDF5-${{ matrix.mpi }} (MacOS)
if: runner.os == 'macOS'
run: brew install hdf5-mpi ninja ${{ matrix.mpi }}
- uses: actions/checkout@v4
- name: Configure
run: >-
cmake
--preset multi
--install-prefix ${{ runner.temp }}
-DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
- name: Build Debug
run: cmake --build --preset debug
- name: Test Debug
run: ctest --preset debug
- name: Build Release
run: cmake --build --preset release
- name: Test Release
run: ctest --preset release
- name: install package
run: cmake --install build
- name: example config
run: >-
cmake
--preset default
-GNinja
-DCMAKE_PREFIX_PATH:PATH=${{ runner.temp }}
working-directory: example
- name: example build
run: cmake --build --preset default
working-directory: example
- name: example test
run: ctest --preset default
working-directory: example
linux-coverage:
# GCOVR doesn't work with .inc files right now
if: false
needs: core
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: install hdf5
run: |
sudo apt update
sudo apt install --no-install-recommends libhdf5-mpi-dev mpi-default-dev mpi-default-bin
- name: install Gcovr
run: pip install gcovr
- run: cmake --preset coverage
- run: cmake --build --preset coverage
- name: Code coverage
run: cmake --build --preset run-coverage
- uses: actions/upload-artifact@v4
with:
name: coverage-report-html
path: build-coverage/coverage/