Skip to content

Commit

Permalink
ci: consolidate
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jan 8, 2024
1 parent 92d38f8 commit 327e35b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 86 deletions.
97 changes: 12 additions & 85 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,25 @@ on:
jobs:

base:
runs-on: ${{ matrix.img.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
shared: [true, false]
img: [
{os: ubuntu-latest, cmd: sudo apt update && sudo apt install --no-install-recommends ninja-build libnetcdff-dev},
]
build: [true, false]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: install system libs
run: ${{ matrix.img.cmd }}
- name: install NetCDF system libs
if: runner.os == 'Linux' && matrix.build == 'false'
run: sudo apt install --no-install-recommends ninja-build libnetcdff-dev

- name: install HDF5 system libs
if: runner.os == 'macOS' && matrix.build == 'false'
run: brew install netcdf

- run: >-
cmake
Expand Down Expand Up @@ -60,53 +64,14 @@ jobs:
- name: Test examples
run: ctest --test-dir example/build -V


linux-build:
needs: base
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v3

- name: install libs
run: |
sudo apt update
sudo apt install --no-install-recommends libhdf5-dev
- name: Configure NetCDF4
run: cmake -S scripts -B scripts/build -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}

- name: Build/install NetCDF4
run: cmake --build scripts/build --parallel

- name: configure nc4fortran
run: >-
cmake
--preset default
--install-prefix ${{ runner.temp }}
-DCMAKE_PREFIX_PATH=${{ runner.temp }}
- run: cmake --build --preset default --parallel
- run: ctest --preset default
- run: cmake --install build

- name: configure examples
run: cmake -S example -B example/build -DCMAKE_PREFIX_PATH=${{ runner.temp }}
- name: build examples
run: cmake --build example/build --parallel
- 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@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.x'
Expand All @@ -129,41 +94,3 @@ jobs:
with:
name: coverage-report-html
path: build-coverage/coverage/



mac:
runs-on: macos-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v3

- name: install libs
run: |
brew install hdf5 netcdf
brew reinstall gcc
- name: Configure NetCDF4
run: cmake -S scripts -B scripts/build --install-prefix ${{ runner.temp }}

- name: Build/install NetCDF4
run: cmake --build scripts/build --parallel

- name: configure nc4fortran
run: >-
cmake
--preset default
--install-prefix ${{ runner.temp }}
-DCMAKE_PREFIX_PATH=${{ runner.temp }}
- run: cmake --build --preset default
- run: ctest --preset default
- run: cmake --install build

- name: configure examples
run: cmake -S example -B example/build -DCMAKE_PREFIX_PATH=${{ runner.temp }}
- name: build examples
run: cmake --build example/build --parallel
- name: Test examples
run: ctest --test-dir example/build -V
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Object-oriented Fortran NetCDF4 interface

[![DOI](https://zenodo.org/badge/229812591.svg)](https://zenodo.org/badge/latestdoi/229812591)
![ci](https://github.com/geospace-code/nc4fortran/workflows/ci/badge.svg)
[![ci](https://github.com/geospace-code/nc4fortran/actions/workflows/ci.yml/badge.svg)](https://github.com/geospace-code/nc4fortran/actions/workflows/ci.yml)
[![ci_windows](https://github.com/geospace-code/nc4fortran/actions/workflows/ci_windows.yml/badge.svg)](https://github.com/geospace-code/nc4fortran/actions/workflows/ci_windows.yml)
[![ci_fpm](https://github.com/geospace-code/nc4fortran/actions/workflows/ci_fpm.yml/badge.svg)](https://github.com/geospace-code/nc4fortran/actions/workflows/ci_fpm.yml)

Expand Down

0 comments on commit 327e35b

Please sign in to comment.