Book Diversification by Author #219
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: PR gate | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| # Only trigger the workflow with a PR to main | |
| branches: | |
| - main | |
| - dev | |
| # Enable manual trigger | |
| workflow_dispatch: | |
| input: | |
| tags: | |
| description: "Tags to label this manual run (optional)" | |
| default: "Manual run" | |
| # Automatically cancel previous workflows if a new one is executed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Test Python ${{ matrix.python }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 40 | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 20 # Usage limits: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration | |
| matrix: | |
| os: [ubuntu-24.04] # Available images: https://github.com/actions/runner-images/#available-images | |
| python: ["3.10", "3.11"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 # Info: https://github.com/actions/checkout | |
| - name: Use Python ${{ matrix.python }} | |
| uses: actions/setup-python@v5 # Info: https://github.com/actions/setup-python | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Install dependencies | |
| run: | | |
| uv venv | |
| uv pip install -e ".[dev]" | |
| - name: Python version and dependency list | |
| run: | | |
| echo "Python version expected: ${{ matrix.python }}" | |
| uv run python --version | |
| uv run python -c "import sys; print(sys.executable)" | |
| uv run pip list | |
| - name: Run tests | |
| run: | | |
| uv run pytest tests --disable-warnings --durations 0 |