Files
rendercv/.github/workflows/test.yaml
Sina Atalay 5156f7799e Switch to uv (#515)
* Update pyproject.toml

* Create justfile

* Move `rendercv` to `src/rendercv`

* Polish pyproject.toml

* Update workflows

* Remove issue templates (no need)

* Fix mistakes in workflows

* Improve workflows

* Remove devcontainer

* Use uv

* Minor update

* Use .yaml instead of .yml

* Update test.yaml triggers

* Use --all-groups in uv sync

* Make theme options compatible with pydantic 3.12.*

* Fix coverage issue
2025-10-28 17:32:57 +03:00

90 lines
2.6 KiB
YAML

name: Test
# GitHub events that trigger the workflow:
on:
push:
branches:
- main
pull_request:
branches:
- "*"
workflow_call: # to make the workflow triggerable from other workflows
workflow_dispatch: # to make the workflow triggerable manually
# The workflow:
jobs:
test:
name: Test with Py${{ matrix.python-version }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install just
uses: taiki-e/install-action@just
- name: Install the project
run: uv sync --locked --all-extras --all-groups
- name: Test
run: just test-with-coverage
- name: Rename the coverage file
run: mv .coverage .coverage.${{ matrix.python-version }}.${{ matrix.os }}
- name: Upload coverage as an artifact
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: coverage-${{ matrix.python-version }}-${{ matrix.os }}
path: .coverage.${{ matrix.python-version }}.${{ matrix.os }}
report-coverage:
# Run only if the workflow was triggered by a push event
if: github.event_name == 'push'
name: Generate the coverage report
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Download coverage files
uses: actions/download-artifact@v5
with:
pattern: coverage-* # download all the uploaded coverage reports
path: coverage
merge-multiple: true # download them in the same folder
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install the project
run: uv sync --locked --all-extras --all-groups
- name: Install just
uses: taiki-e/install-action@just
- name: Combine coverage files
run: |
uv run coverage combine coverage
uv run coverage report
uv run coverage html --show-contexts --title "RenderCV coverage for ${{ github.sha }}"
- name: Upload the coverage report to smokeshow
run: uv tool run smokeshow==0.4.0 upload ./htmlcov
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 90
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}