ci:oneapi: parallel build #229
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
env: | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
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 | |
- 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 | |
-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/ |