Merge pull request #259 from xen0n/bump-pygit2 #245
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: ${{ matrix.runs_on }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: true | |
matrix: | |
python: | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
experimental: [false] | |
baseline: [false] | |
runs_on: ['ubuntu-latest'] | |
include: | |
- python: '3.13' | |
baseline: false | |
experimental: true | |
runs_on: ubuntu-latest | |
- python: '3.10' | |
baseline: true | |
experimental: false | |
runs_on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install baseline deps system-wide | |
if: success() && matrix.baseline | |
run: ./scripts/install-baseline-deps.sh | |
- name: Install Poetry | |
if: success() && !matrix.baseline | |
run: pipx install poetry | |
# NOTE: the Poetry venv is created during this step | |
- uses: actions/setup-python@v5 | |
if: success() && !matrix.baseline | |
with: | |
python-version: ${{ matrix.python }} | |
cache: poetry | |
- name: Install deps in the venv | |
if: success() && !matrix.baseline | |
run: poetry install --with=dev | |
# it seems hard for Poetry to only install the dev tools but not break | |
# referencing system-wide deps, in addition to the trouble of | |
# type-checking with ancient versions of deps that lack type | |
# annotations, so just rely on the CI job running with non-baseline deps | |
# for the various lints (but not tests). | |
- name: Lint with ruff | |
if: success() && !matrix.baseline | |
run: poetry run ruff check | |
- name: Type-check with mypy | |
if: success() && !matrix.baseline | |
run: poetry run mypy | |
- name: Type-check with pyright | |
if: success() && !matrix.baseline | |
run: poetry run -- pyright --pythonversion ${{ matrix.python }} | |
- name: Test with pytest (in venv) | |
if: success() && !matrix.baseline | |
run: poetry run pytest | |
- name: Test with pytest (system-wide) | |
if: success() && matrix.baseline | |
run: | | |
pip install -e . | |
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 |