Update change log #120
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: | |
| - master | |
| - main | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| jobs: | |
| tests: | |
| name: Tests | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "3.8" | |
| - "3.9" | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| - "3.14" | |
| os: | |
| - ubuntu-latest | |
| # - macOS-latest | |
| # - windows-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run Tests | |
| run: | | |
| # Run slow tests on main/master branch pushes and ready-for-review PRs | |
| # Run fast tests only on draft PRs | |
| if [[ "${{ github.event_name }}" == "push" ]] || [[ "${{ github.event.pull_request.draft }}" == "false" ]]; then | |
| echo "Running all tests including slow tests" | |
| uv run coverage run -m pytest --runslow | |
| else | |
| echo "Running fast tests only (draft PR)" | |
| uv run coverage run -m pytest | |
| fi | |
| - name: Upload coverage data | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: coverage-data-${{ matrix.python-version }} | |
| path: .coverage.* | |
| include-hidden-files: true | |
| if-no-files-found: ignore | |
| coverage: | |
| name: Combine coverage | |
| runs-on: ubuntu-latest | |
| needs: tests | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| # Use latest, so it understands all syntax. | |
| python-version: "3.12" | |
| - run: python -m pip install --upgrade coverage[toml] | |
| - name: Download coverage data | |
| uses: actions/download-artifact@v7 | |
| with: | |
| pattern: coverage-data-* | |
| merge-multiple: true | |
| - name: Combine coverage | |
| run: | | |
| python -m coverage combine | |
| python -m coverage html --skip-covered --skip-empty | |
| python -m coverage json | |
| TOTAL=$(python -c "import json;print(json.load(open('reports/coverage/coverage.json'))['totals']['percent_covered_display'])") | |
| REPORT=$(python -m coverage report) | |
| echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| echo "${REPORT}" >> $GITHUB_STEP_SUMMARY | |
| echo '```' >> $GITHUB_STEP_SUMMARY | |
| - name: Upload HTML report | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: html-report | |
| path: reports/coverage/html |