Merge pull request #671 from andrsd/cmake-updates #1890
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: build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: "${{ matrix.os }}, ${{ matrix.build }}, py-${{ matrix.python-version }}, petsc-${{ matrix.petsc }}" | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
python-version: "3.9" | |
petsc: 3.20.6 | |
build: Debug | |
- os: ubuntu-22.04 | |
python-version: "3.9" | |
petsc: 3.20.6 | |
build: Release | |
- os: ubuntu-22.04 | |
python-version: "3.9" | |
petsc: 3.21.6 | |
build: Release | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up miniconda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
auto-update-conda: false | |
channels: andrsd,defaults | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
conda install \ | |
cmake \ | |
make \ | |
mpich-mpicxx \ | |
mpicpp-lite==1.3 \ | |
petsc==${{ matrix.petsc }} \ | |
fmt==9.1.0 \ | |
yaml-cpp=0.8.0 \ | |
exodusIIcpp==2.0 \ | |
lcov | |
- name: Configure | |
run: | | |
cmake -S ${{ github.workspace }} -B ${{ github.workspace }}/build \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.build }} \ | |
-DGODZILLA_BUILD_EXAMPLES=YES \ | |
-DGODZILLA_BUILD_TESTS=YES \ | |
-DGODZILLA_CODE_COVERAGE=YES | |
- name: Build | |
run: make -C ${{ github.workspace }}/build | |
- name: Run tests | |
run: make -C ${{ github.workspace }}/build test ARGS='-V' | |
- name: Generate code coverage | |
run: make -C ${{ github.workspace }}/build coverage | |
- name: Upload coverage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-${{ matrix.os }}-${{ matrix.build }}-petsc-${{ matrix.petsc }} | |
path: ${{ github.workspace }}/build/coverage.info | |
upload-to-codecov: | |
needs: [build] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |