Skip to content

Bump actions/download-artifact from 4 to 7 #278

Bump actions/download-artifact from 4 to 7

Bump actions/download-artifact from 4 to 7 #278

Workflow file for this run

name: check
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
test:
name: test ${{ matrix.py }} on postgres ${{ matrix.postgres-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py:
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
postgres-version:
- 14
- 15
- 16
- 17
- 18
steps:
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.py }}
- uses: actions/checkout@v6
- name: Create database
run: |
# maps the container port to localhost
docker run --name db -p 5432:5432 -d -e POSTGRES_PASSWORD=postgres postgres:${{ matrix.postgres-version }}
sleep 10 # wait for server to initialize
- name: Install tox-gh
run: python -m pip install tox-gh
- name: Run test suite
run: tox
- name: Upload coverage
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.py }}-${{ matrix.postgres-version }}
path: |
.coverage.*
pytest.*.xml
include-hidden-files: true
if-no-files-found: ignore
coverage:
name: report coverage
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v6
- name: Download all coverage artifacts
uses: actions/download-artifact@v7
with:
path: coverage-reports
pattern: coverage-*
merge-multiple: true
- name: Setup python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: pip install coverage junitparser
- name: Combine coverage
run: |
coverage combine coverage-reports/
coverage xml
coverage report -m > coverage.txt
- name: Merge JUnit XML
run: |
junitparser merge coverage-reports/pytest.*.xml junit.xml
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: coverage.xml
pytest-coverage-path: coverage.txt
junitxml-path: ./junit.xml
title: Coverage Report
badge-title: Coverage
hide-badge: false
hide-report: false
create-new-comment: false
github-token: ${{ secrets.GITHUB_TOKEN }}
report-only-changed-files: true
xml-skip-covered: true