Disable cache for pytest (#992) #97
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: test_coverage | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
coverage: | |
name: coverage-${{ matrix.el.distro }}${{ matrix.el.ver }} | |
strategy: | |
fail-fast: false | |
matrix: | |
el: | |
- distro: centos | |
ver: 7 | |
- distro: centos | |
ver: 8 | |
- distro: centos | |
ver: 9 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run pytest coverage | |
run: | | |
make tests${{ matrix.el.ver }} PYTEST_ARGS="--cov --cov-report xml --cov-report term" KEEP_TEST_CONTAINER=1 BUILD_IMAGES=0 | |
podman cp pytest-container:/data/coverage.xml . | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
env_vars: OS,PYTHON | |
flags: ${{ matrix.el.distro }}-linux-${{ matrix.el.ver }} | |
name: coverage-${{ matrix.el.distro }} | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
verbose: true # optional (default = false) |