Demo environment bootstrap #113
Workflow file for this run
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: Lint and test jobs poc | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
MYPY_CACHE_DIR: "${{ github.workspace }}/.cache/mypy" | |
RUFF_CACHE_DIR: "${{ github.workspace }}/.cache/ruff" | |
PRE_COMMIT_HOME: "${{ github.workspace }}/.cache/pre-commit" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python and dependencies | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
pip install -U uv | |
uv pip install --system --no-deps . -r requirements-dev.txt | |
- name: Cache pre-commit tools | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ env.MYPY_CACHE_DIR }} | |
${{ env.RUFF_CACHE_DIR }} | |
${{ env.PRE_COMMIT_HOME }} | |
key: ${{ hashFiles('requirements-dev.txt', '.pre-commit-config.yaml') }}-linter-cache | |
- name: Run pre-commit checks | |
run: pre-commit run --all-files --verbose --show-diff-on-failure | |
test: | |
name: Test jobs-infra on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up oldest supported Python on ${{ matrix.os }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Run tests on oldest supported Python | |
run: | | |
pip install -U uv | |
uv pip install --system -r requirements-dev.txt . --no-deps | |
uv pip install --system exceptiongroups # FIXME: This is required due to non-portable dependency resolution in uv pip compile | |
pytest |