-
-
Notifications
You must be signed in to change notification settings - Fork 9
137 lines (102 loc) · 2.79 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
135
136
137
name: ci
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
CMAKE_BUILD_PARALLEL_LEVEL: 4
CTEST_PARALLEL_LEVEL: 0
CTEST_NO_TESTS_ACTION: error
CMAKE_INSTALL_PREFIX: ~/libs
CMAKE_PREFIX_PATH: ~/libs
on:
push:
paths:
- "**/CMakeLists.txt"
- "**.cmake"
- "**.f90"
- ".github/workflows/ci.yml"
- "!cmake/netcdf.cmake"
- "!cmake/netcdf-c.cmake"
- "!cmake/hdf5.cmake"
- "!scripts/**"
jobs:
base:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
FC: gfortran-14
strategy:
matrix:
os: [ubuntu-24.04, macos-latest]
shared: [true, false]
steps:
- uses: actions/checkout@v4
- name: install NetCDF system libs
if: runner.os == 'Linux'
run: sudo apt install --no-install-recommends ninja-build libnetcdff-dev
- name: install NetCDF system libs
if: runner.os == 'macOS'
run: brew install ninja netcdf-fortran
- run: >-
cmake
--preset multi
-DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
- run: cmake --build --preset debug
- run: ctest --preset debug
- run: cmake --build --preset release
- run: ctest --preset release
- run: cmake --install build
- name: configure examples
run: >-
cmake
-S example
-B example/build
-DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
- name: build examples
run: cmake --build example/build
- name: Test examples
run: ctest --test-dir example/build -V
build:
needs: base
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
FC: gfortran-14
strategy:
matrix:
os: [ubuntu-24.04, macos-latest]
steps:
- uses: actions/checkout@v4
- name: install HDF5
if: runner.os == 'macOS'
run: brew install hdf5
- run: cmake --workflow --preset default
- run: cmake --install build
- name: configure examples
run: cmake -S example -B example/build
- name: build examples
run: cmake --build example/build
- name: Test examples
run: ctest --test-dir example/build -V
linux-coverage:
if: github.event_name == 'release'
needs: base
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: install prereqs
run: |
sudo apt update
sudo apt install --no-install-recommends libnetcdff-dev
- 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/