ci: add cache-dependency (#89) #188
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: build-and-test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- "**" | |
- "!docs/**" | |
- "!README.md" | |
- "!.github/**" | |
- .github/workflows/build-and-test.yaml | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Define a cache dependency glob | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
enable-cache: true | |
cache-dependency-glob: "**/pyproject.toml" | |
- name: Install the project | |
run: uv sync | |
- name: Run tests | |
run: uv run pytest --cov-report xml:coverage.xml --cov=t4_devkit | |
- name: Get test coverage | |
uses: orgoro/[email protected] | |
continue-on-error: true | |
with: | |
coverageFile: ./coverage.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
thresholdAll: 0.5 | |
thresholdNew: 0.8 | |
thresholdModified: 0.8 |