Merge pull request #95 from andrsd/dependabot/github_actions/actions/… #266
This file contains hidden or 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 }} | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Set up miniconda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: 3.11 | |
| auto-update-conda: false | |
| channels: andrsd,defaults | |
| - name: Checkout source | |
| uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: | | |
| conda install \ | |
| cmake \ | |
| make \ | |
| mpich-mpicxx \ | |
| exodusii==2024.06.* \ | |
| fmt=11.* \ | |
| yaml-cpp==0.8.0 \ | |
| pybind11 \ | |
| pytest \ | |
| flake8 \ | |
| gtest \ | |
| lcov | |
| - name: Configure | |
| run: | | |
| cmake -S . -B ${{ github.workspace }}/build \ | |
| -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ | |
| -DGCOV_PATH=`which x86_64-conda-linux-gnu-gcov` \ | |
| -DEXODUSIICPP_LIBRARY_TYPE=SHARED \ | |
| -DEXODUSIICPP_WITH_PYTHON=ON \ | |
| -DEXODUSIICPP_BUILD_TESTS=YES \ | |
| -DEXODUSIICPP_CODE_COVERAGE=YES | |
| - name: Build | |
| run: cmake --build ${{ github.workspace }}/build | |
| - name: Install | |
| run: cmake --install ${{ github.workspace }}/build | |
| - name: Run C++ tests | |
| run: | | |
| ${{ github.workspace }}/build/test/exodusIIcpp-test \ | |
| --gtest_output=xml:${{ github.workspace }}/build/gtest-results.xml | |
| - name: Run Python tests | |
| run: | | |
| pytest ${{ github.workspace }}/python/tests | |
| - name: Test summary | |
| uses: test-summary/action@v2 | |
| if: always() | |
| with: | |
| paths: ${{ github.workspace }}/build/gtest-results.xml | |
| show: "fail, skip" | |
| - name: Upload test results to codecov.io | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ${{ github.workspace }}/build/gtest-results.xml | |
| name: ${{ matrix.os }} | |
| - name: Generate code coverage | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| make -C ${{ github.workspace }}/build coverage | |
| - name: Upload coverage artifact | |
| if: startsWith(matrix.os, 'ubuntu') | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage-${{ matrix.os }} | |
| path: ${{ github.workspace }}/build/coverage.info | |
| upload-to-codecov: | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8 | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |