Codecov #38
Workflow file for this run
This file contains hidden or 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: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
- name: Install the project | |
run: uv sync --locked --dev --extra mcp | |
- name: Install pocl | |
run: uv pip install pocl-binary-distribution==3.0 | |
- name: Run tests | |
run: | | |
uv run pytest --cov --cov-branch --cov-report=xml --junitxml=junit.xml -o junit_family=legacy | |
echo $? > pytest-exitcode | |
continue-on-error: true | |
# Always upload coverage and test results, even if tests fail | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
use_oidc: true | |
files: coverage.xml | |
- uses: codecov/test-results-action@v1 | |
with: | |
use_oidc: true | |
files: junit.xml | |
- name: Fail job if pytest failed | |
run: | | |
if [ -f pytest-exitcode ] && [ "$(cat pytest-exitcode)" -ne 0 ]; then | |
echo "Pytest failed, failing job." | |
exit 1 | |
fi | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
- name: Build the project | |
run: uv build | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
- name: Run linters | |
run: uvx ruff check | |
typing: | |
name: typing | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
- name: Install the project | |
run: uv sync --locked --dev --extra mcp | |
- name: Run type checkers | |
run: uv run pyrefly check src tests |