Blas\Lapack (#52) #30
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: Quality Metrics | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| PRIK_GFORTRAN_BINARY: gfortran-13 | |
| PRIK_GFORTRAN_PACKAGE: gfortran-13 | |
| jobs: | |
| coverage: | |
| name: Project coverage · Ubuntu 24.04 · Python 3.12 | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install coverage dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e ".[qa]" | |
| - name: Install pinned GFortran | |
| shell: bash | |
| run: | | |
| if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1; then | |
| sudo apt-get update | |
| sudo apt-get install --yes "$PRIK_GFORTRAN_PACKAGE" | |
| fi | |
| compiler_dir="$RUNNER_TEMP/prik-gfortran" | |
| mkdir -p "$compiler_dir" | |
| ln -sf "$(command -v "$PRIK_GFORTRAN_BINARY")" "$compiler_dir/gfortran" | |
| echo "$compiler_dir" >> "$GITHUB_PATH" | |
| "$compiler_dir/gfortran" --version | |
| - name: Run tests with coverage | |
| shell: bash | |
| env: | |
| PYTHONPATH: . | |
| HYPOTHESIS_PROFILE: ci | |
| COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml | |
| run: | | |
| python -m coverage run -m pytest -q --randomly-seed=1 \ | |
| -o junit_family=legacy \ | |
| --junitxml="$RUNNER_TEMP/pytest-smoke-results.xml" \ | |
| tests/fortran \ | |
| -m toolchain_smoke \ | |
| --require-toolchain-smoke \ | |
| --prik-fortran-compiler=gfortran | |
| python -m coverage run -m pytest -q --randomly-seed=1 \ | |
| -o junit_family=legacy \ | |
| --junitxml="$RUNNER_TEMP/pytest-suite-results.xml" \ | |
| -m "not real_library and not toolchain_smoke" \ | |
| tests/architecture \ | |
| tests/c \ | |
| tests/fortran \ | |
| tests/shared | |
| - name: Summarize failed pytest nodes | |
| if: failure() | |
| shell: bash | |
| run: | | |
| shopt -s nullglob | |
| reports=("$RUNNER_TEMP"/pytest-*-results.xml) | |
| for report in "${reports[@]}"; do | |
| python tools/print_pytest_failures.py "$report" | |
| done | |
| - name: Combine coverage data | |
| run: python -m coverage combine | |
| - name: Report coverage | |
| run: python -m coverage report | |
| - name: Emit coverage XML | |
| run: python -m coverage xml -o coverage.xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| files: ./coverage.xml | |
| flags: py312 | |
| use_oidc: true | |
| fail_ci_if_error: true |