Skip to content

Fix codecov upload token authentication error in GitHub Actions #7

Fix codecov upload token authentication error in GitHub Actions

Fix codecov upload token authentication error in GitHub Actions #7

Workflow file for this run

name: Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Run tests with pytest
run: uv run pytest tests/ -v --tb=short
- name: Run tests with coverage
run: uv run coverage run -m pytest tests/
- name: Generate coverage report
run: uv run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: ${{ secrets.CODECOV_TOKEN != '' }}

Check failure on line 43 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Tests

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 43, Col: 11): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.CODECOV_TOKEN != ''
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false