Add best-effort affinity-aware job queuing #196
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: | |
| - master | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - master | |
| env: | |
| PIP_DISABLE_PIP_VERSION_CHECK: '1' | |
| jobs: | |
| Test: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| include: | |
| # With the Redis client | |
| - { python-version: '3.10', install-extra: '[redis]' } | |
| - { python-version: '3.11', install-extra: '[redis]' } | |
| - { python-version: '3.12', install-extra: '[redis]' } | |
| - { python-version: '3.13', install-extra: '[redis]' } | |
| - { python-version: '3.13', install-extra: '[redis,sentry]'} | |
| - { python-version: '3.13', install-extra: '[redis,sentry,orjson]'} | |
| # With the Valkey server | |
| - { python-version: '3.13', install-extra: '[redis]', redis-image: 'valkey/valkey:8'} | |
| # With the Valkey client and Valkey server | |
| - { python-version: '3.13', install-extra: '[valkey,sentry]', redis-image: 'valkey/valkey:8'} | |
| services: | |
| redis: | |
| image: ${{ matrix.redis-image || 'redis' }} | |
| ports: | |
| - 6379:6379 | |
| env: | |
| REDIS_URL: 'redis://localhost:6379/0' | |
| SENTRY_DSN: 'http://user:pass@localhost:12340/foo' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: 'Set up Python ${{ matrix.python-version }}' | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| python-version: '${{ matrix.python-version }}' | |
| activate-environment: true | |
| - run: 'uv pip install -e ".$EXTRA"' | |
| env: | |
| EXTRA: '${{ matrix.install-extra }}' | |
| - run: uv run pytest -vvv --cov . | |
| - uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| name: 'Python ${{ matrix.python-version }}' | |
| Lint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| cache-dependency-glob: ".github/workflows/*.yml" | |
| cache-suffix: pre-commit-uv | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-uv-v1-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - run: uvx --with=pre-commit-uv pre-commit run --all-files --show-diff-on-failure --color=always | |
| Mypy: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| python-version: '3.13' | |
| activate-environment: 'true' | |
| # `mypy` requires `pip` to install types... | |
| - run: uv run --with=pip --all-extras mypy --strict --install-types --non-interactive --show-error-codes minique | |
| Build: | |
| runs-on: ubuntu-24.04 | |
| needs: [ Lint, Mypy, Test ] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| with: | |
| python-version: '3.13' | |
| - run: uv build | |
| - run: uvx twine check dist/* | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: build | |
| path: dist | |
| - name: Publish distribution to PyPI | |
| if: startsWith(github.ref, 'refs/tags') | |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 | |
| with: | |
| print_hash: true | |
| password: ${{ secrets.PYPI_API_TOKEN }} |