Ensure compatibility with the platform support baseline in CI #218
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: PR checks | |
on: | |
push: | |
paths: | |
- pyproject.toml | |
- poetry.lock | |
- '**.py' | |
- '.github/**' | |
- 'resources/**' | |
- 'scripts/**' | |
- 'tests/**' | |
pull_request: | |
paths: | |
- pyproject.toml | |
- poetry.lock | |
- '**.py' | |
- '.github/**' | |
- 'resources/**' | |
- 'scripts/**' | |
- 'tests/**' | |
jobs: | |
lint: | |
name: "lint & typecheck & test (Python ${{ matrix.python }}${{ matrix.baseline && ', baseline deps' || '' }}${{ matrix.experimental && ', experimental' || '' }})" | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: true | |
matrix: | |
python: | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
experimental: [false] | |
baseline: [false] | |
include: | |
- python: '3.13' | |
baseline: false | |
experimental: true | |
- python: '3.10' | |
baseline: true | |
experimental: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install deps system-wide | |
if: success() && matrix.baseline | |
run: | | |
./scripts/install-baseline-deps.sh | |
# give the Poetry environment access to the system-wide deps | |
# this has to be done before virtualenv creation | |
export POETRY_VIRTUALENVS_OPTIONS_SYSTEM_SITE_PACKAGES=true | |
- name: Install Poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: poetry | |
- name: Install deps in the venv | |
if: success() && !matrix.baseline | |
run: poetry install --with=dev | |
- name: Install only the dev tools in the venv | |
if: success() && matrix.baseline | |
run: poetry install --only=dev | |
- name: Lint with ruff | |
run: poetry run ruff check | |
- name: Type-check with mypy | |
# it is rather cumbersome to work with ancient versions of deps that | |
# lack type annotations, so just rely on the CI job running with | |
# non-baseline deps | |
if: success() && !matrix.baseline | |
run: poetry run mypy | |
- name: Type-check with pyright | |
# same with pyright | |
if: success() && !matrix.baseline | |
run: poetry run -- pyright --pythonversion ${{ matrix.python }} | |
- name: Test with pytest | |
run: poetry run pytest | |
pylic: | |
name: license compatibility | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v5 | |
with: | |
python-version-file: 'pyproject.toml' | |
cache: poetry | |
- name: Install runtime deps | |
run: poetry install --only=main,dev | |
- name: Install pylic | |
run: poetry run pip install pylic | |
- name: List all licenses involved | |
run: poetry run pylic list | |
- name: Check license compatibility with pylic | |
run: poetry run pylic check | |
shellcheck: | |
name: Lint shell scripts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Lint with shellcheck | |
run: ./scripts/lint-shell-scripts.sh |