-
Notifications
You must be signed in to change notification settings - Fork 4
CI: run tests in Matrix and upload only 3.12 to Codecov #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,7 +11,7 @@ permissions: | |||||
| id-token: write | ||||||
|
|
||||||
| jobs: | ||||||
| lint-test: | ||||||
| lint: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Checkout repository | ||||||
|
|
@@ -45,21 +45,77 @@ jobs: | |||||
| - name: Run mypy | ||||||
| run: uv run mypy --strict src/ tests/ | ||||||
|
|
||||||
| - name: Run tests | ||||||
| test: | ||||||
| runs-on: ubuntu-latest | ||||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | ||||||
| steps: | ||||||
| - name: Checkout repository | ||||||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||||||
| with: | ||||||
| persist-credentials: false | ||||||
|
|
||||||
| - name: Install uv | ||||||
| uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0 | ||||||
| with: | ||||||
| enable-cache: true | ||||||
| resolution-strategy: "lowest" | ||||||
|
|
||||||
| - name: Setup Python | ||||||
| uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 | ||||||
| with: | ||||||
| python-version: ${{ matrix.python-version }} | ||||||
|
|
||||||
| - name: Sync dependencies | ||||||
| run: uv sync --group dev --group tests | ||||||
|
|
||||||
| - name: Run tests with coverage | ||||||
| run: uv run python -m coverage run -m pytest -v --junitxml=junit.xml | ||||||
|
|
||||||
| - name: Create coverage report | ||||||
| run: uv run coverage xml | ||||||
| run: uv run coverage xml -o coverage.xml | ||||||
|
|
||||||
| - name: Upload coverage reports to Codecov | ||||||
| - name: Upload coverage reports | ||||||
| if: ${{ !cancelled() }} | ||||||
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | ||||||
| with: | ||||||
| name: coverage-py${{ matrix.python-version }} | ||||||
| path: | | ||||||
| coverage.xml | ||||||
| junit.xml | ||||||
| if-no-files-found: error | ||||||
|
|
||||||
| codecov: | ||||||
| runs-on: ubuntu-latest | ||||||
| needs: [test] | ||||||
| if: ${{ always() }} | ||||||
| steps: | ||||||
| - name: Checkout repository | ||||||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | ||||||
| with: | ||||||
| persist-credentials: false | ||||||
|
|
||||||
| - name: Download coverage reports | ||||||
| if: ${{ !cancelled() }} | ||||||
shenanigansd marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 | ||||||
| with: | ||||||
| name: coverage-py3.14 | ||||||
|
||||||
| name: coverage-py3.14 | |
| name: coverage-py3.12 |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The codecov job uses "if: always()" which means it will run even if the test job fails. However, the download-artifact step uses "if: !cancelled()" which may cause issues if the test job fails and no artifact is produced. Consider adding a check to ensure the artifact exists before attempting to download, or adjust the condition to handle cases where tests fail for Python 3.12.
Uh oh!
There was an error while loading. Please reload this page.