Skip to content

👷 Update release workflow #41

👷 Update release workflow

👷 Update release workflow #41

Workflow file for this run

name: Code Coverage
on:
push:
branches:
- main
pull_request:
paths:
- "envs/**"
- "aioarxiv/**"
- "tests/**"
- ".github/workflows/codecov.yml"
- "pyproject.toml"
- "pdm.lock"
workflow_dispatch:
jobs:
test:
name: Test Coverage
runs-on: ${{ matrix.os }}
concurrency:
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
with-groups: "test"
no-root: "false"
- name: Run Tests with Coverage
shell: bash
run: |
pdm run pytest tests/ \
--cov=aioarxiv \
--cov-report=xml:coverage.xml \
--cov-report=term \
--cov-report=html:coverage_html \
--junitxml=pytest.xml \
-o junit_family=legacy \
-v
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: BalconyJH/aioarxiv
directory: ./
env_vars: OS,PYTHON_VERSION
files: ./coverage.xml,./pytest.xml
flags: pytest-${{ matrix.python-version }}-${{ matrix.os }}
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage html report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-html-${{ matrix.python-version }}-${{ matrix.os }}
path: coverage_html/
retention-days: 14