ci: add CODECOV_TOKEN to coverage upload step in CI workflow #19
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Check formatting with black | |
run: poetry run black . --check --diff | |
- name: Check imports with isort | |
run: poetry run isort . --check --diff | |
- name: Type check with mypy | |
run: poetry run mypy trackerstatus tests | |
- name: Lint with pylint | |
run: poetry run pylint --disable=C0114,W0621,W0212,R0801,W0719,R0903,W0246,W0611,W0401,W0613,W0703,W0702,W0603,W0602,W0601,W0511,W0406,W0404,W0403,W0402,W0401,W0311,W0301,W0223,W0222,W0221,W0211,W0201,W0120,W0110,W0109,W0108,W0107,W0106,W0105,W0104,W0103,W0102,W0101,W0001 --min-similarity-lines=10 --fail-under=8.0 trackerstatus tests | |
- name: Run tests with pytest and coverage | |
run: | | |
poetry run pytest --cov=trackerstatus --cov-report=xml --cov-report=html -v | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: ./coverage.xml | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report-${{ matrix.python-version }} | |
path: htmlcov/ | |
- name: Upload test logs | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-logs-${{ matrix.python-version }} | |
path: | | |
.pytest_cache/ | |
.coverage | |
coverage.xml |