@@ -2,11 +2,9 @@ name: ci
22
33env :
44 HOMEBREW_NO_INSTALL_CLEANUP : 1
5- CMAKE_BUILD_PARALLEL_LEVEL : 4
6- CTEST_PARALLEL_LEVEL : 0
7- CTEST_NO_TESTS_ACTION : error
85 CMAKE_INSTALL_PREFIX : ~/libs
96 CMAKE_PREFIX_PATH : ~/libs
7+ CMAKE_GENERATOR : Ninja
108
119on :
1210 push :
@@ -35,44 +33,59 @@ jobs:
3533 strategy :
3634 matrix :
3735 os : [ubuntu-latest, macos-latest]
38- shared : [true, false]
3936
4037 steps :
41- - uses : actions/checkout@v4
4238
43- - name : install NetCDF system libs
39+ - &checkout
40+ uses : actions/checkout@v6
41+
42+ - &ncdf-linux
43+ name : install NetCDF (Linux)
4444 if : runner.os == 'Linux'
45- run : sudo apt install --no-install-recommends libnetcdff-dev
45+ run : |
46+ sudo apt update
47+ sudo apt install --no-install-recommends libnetcdff-dev
4648
47- - name : install NetCDF system libs
49+ - &ncdf-macos
50+ name : install NetCDF (macOS)
4851 if : runner.os == 'macOS'
4952 run : brew install netcdf-fortran
5053
51- - run : >-
52- cmake
53- --preset multi
54- -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
54+ - run : cmake --workflow debug
55+ - run : cmake --workflow release
5556
56- - run : cmake --build --preset debug
57- - run : ctest --preset debug
57+ - run : cmake --install build
5858
59- - run : cmake --build --preset release
60- - run : ctest --preset release
59+ - &example
60+ name : Example workflow
61+ working-directory : example
62+ run : cmake --workflow default
6163
62- - run : cmake --install build
64+ shared :
65+ runs-on : ${{ matrix.os }}
66+ timeout-minutes : 15
67+
68+ env :
69+ FC : gfortran-14
70+
71+ strategy :
72+ matrix :
73+ os : [ubuntu-latest, macos-latest]
74+
75+ steps :
76+
77+ - *checkout
78+
79+ - *ncdf-linux
80+
81+ - *ncdf-macos
82+
83+ - run : cmake --workflow shared
6384
64- - name : configure examples
65- run : >-
66- cmake
67- -S example
68- -B example/build
69- -DBUILD_SHARED_LIBS:BOOL=${{ matrix.shared }}
85+ - run : cmake --install build
7086
71- - name : build examples
72- run : cmake --build example/build
87+ - *example
7388
74- - name : Test examples
75- run : ctest --test-dir example/build -V
7689
7790 build :
7891 needs : base
@@ -81,51 +94,42 @@ jobs:
8194 timeout-minutes : 15
8295
8396 env :
97+ CC : gcc-14
8498 FC : gfortran-14
8599
86100 strategy :
87101 matrix :
88102 os : [ubuntu-latest, macos-latest]
89103
90104 steps :
91- - uses : actions/ checkout@v4
105+ - * checkout
92106
93107 - name : install HDF5 (macOS)
94108 if : runner.os == 'macOS'
95109 run : brew install hdf5
96110
97111 - name : install HDF5 (Linux)
98- if : runner.os == 'Linux'
99- run : sudo apt install --no-install-recommends libhdf5-dev
100-
101- - name : GCC Linux
102112 if : runner.os == 'Linux'
103113 run : |
104- echo "CC=gcc-14" >> $GITHUB_ENV
114+ sudo apt update
115+ sudo apt install --no-install-recommends libhdf5-dev
105116
106117 - run : cmake --workflow default
107118
108119 - run : cmake --install build
109120
110- - name : configure examples
111- run : cmake -S example -B example/build
112-
113- - name : build examples
114- run : cmake --build example/build
115-
116- - name : Test examples
117- run : ctest --test-dir example/build -V
121+ - *example
118122
119123
120124 linux-coverage :
121- if : github.event_name == 'release'
125+ if : false
122126 needs : base
123127 runs-on : ubuntu-latest
124128 timeout-minutes : 10
125129
126130 steps :
127- - uses : actions/ checkout@v4
128- - uses : actions/setup-python@v5
131+ - * checkout
132+ - uses : actions/setup-python@v6
129133 with :
130134 python-version : ' 3.x'
131135
@@ -137,13 +141,9 @@ jobs:
137141 - name : install Gcovr
138142 run : pip install gcovr
139143
140- - run : cmake --preset coverage
141- - run : cmake --build --preset coverage
142-
143- - name : Code coverage
144- run : cmake --build --preset run-coverage
144+ - run : cmake --workflow coverage
145145
146- - uses : actions/upload-artifact@v4
146+ - uses : actions/upload-artifact@v7
147147 with :
148148 name : coverage-report-html
149149 path : build-coverage/coverage/
0 commit comments