-
-
Notifications
You must be signed in to change notification settings - Fork 9
131 lines (99 loc) · 2.71 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
name: ci
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
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-13
strategy:
matrix:
os: [ubuntu-latest, 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
- 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
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/build/local
-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-13
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- run: cmake --workflow --preset default
- run: cmake --install build
- name: configure examples
run: >-
cmake
-S example
-B example/build
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/build/local
- 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@v4
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 --parallel
- name: Code coverage
run: cmake --build --preset run-coverage
- uses: actions/upload-artifact@v4
with:
name: coverage-report-html
path: build-coverage/coverage/