Reduce CI matrix #7
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
# Lock dependencies if necessary, then test, lint, and update.comps | |
name: "ci" | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- ".github/workflows/ci.yml" | |
- "**/pyproject.toml" | |
- "requirements/**" | |
- "scripts/Sync-Py.ps1" | |
- "src/**" | |
- "tests/**" | |
- "scripts/softboiler_github_io_tools/**" | |
- "submodules/**" | |
- "codecov.yml" | |
- "params.yaml" | |
push: | |
branches: ["main"] | |
paths: | |
- ".github/workflows/ci.yml" | |
- "**/pyproject.toml" | |
- "requirements/**" | |
- "scripts/Sync-Py.ps1" | |
- "src/**" | |
- "tests/**" | |
- "scripts/softboiler_github_io_tools/**" | |
- "submodules/**" | |
- "codecov.yml" | |
- "params.yaml" | |
defaults: | |
run: | |
shell: "pwsh" | |
jobs: | |
ruff: | |
runs-on: "ubuntu-22.04" | |
steps: | |
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1 | |
with: | |
submodules: True | |
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0 | |
with: | |
python-version: "3.11" | |
- run: "scripts/Sync-Py.ps1 -Compile" | |
- run: "ruff --no-fix --output-format github ." | |
fawltydeps: | |
runs-on: "ubuntu-22.04" | |
steps: | |
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1 | |
with: | |
submodules: True | |
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0 | |
with: | |
python-version: "3.11" | |
- run: "scripts/Sync-Py.ps1 -Compile" | |
- run: "fawltydeps" | |
pyright: | |
runs-on: "ubuntu-22.04" | |
steps: | |
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1 | |
with: | |
submodules: True | |
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0 | |
with: | |
python-version: "3.11" | |
- run: "scripts/Sync-Py.ps1 -Compile" | |
- run: pyright | |
test: | |
strategy: | |
matrix: | |
runner: | |
- "macos-13" | |
- "macos-14" | |
- "ubuntu-22.04" | |
- "windows-2022" | |
python: | |
# - "3.10" # `scripts` currently requires `tomllib`, which is > 3.10 | |
- "3.11" | |
- "3.12" | |
# - "3.13.0-alpha.5" # `copier` tooling dep failing on 3.13 | |
runs-on: "${{ matrix.runner }}" | |
steps: | |
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1 | |
with: | |
submodules: True | |
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0 | |
with: | |
python-version: "${{ matrix.python }}" | |
- run: "scripts/Sync-Py.ps1 -Compile -Version '${{ matrix.python }}'" | |
# ! https://github.com/pytest-dev/pytest-cov/issues/479#issuecomment-1247444988 | |
- run: "pytest --cov --cov-config pyproject.toml" | |
- if: startsWith(matrix.runner, 'ubuntu') && matrix.python == '3.11' | |
uses: "codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab" # v4.1.0 | |
env: | |
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" | |
- uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1 | |
with: | |
path: ".comps" | |
name: "requirements_${{ matrix.runner }}_${{ matrix.python }}" | |
bump: | |
if: github.event_name == 'pull_request' | |
permissions: | |
contents: "write" | |
needs: | |
- "ruff" | |
- "fawltydeps" | |
- "pyright" | |
- "test" | |
runs-on: "ubuntu-22.04" | |
steps: | |
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1 | |
with: | |
submodules: True | |
- uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0 | |
with: | |
python-version: "3.11" | |
- uses: "actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427" # v4.1.4 | |
with: | |
path: ".comps" | |
merge-multiple: True | |
- if: github.actor == 'renovate[bot]' | |
run: "scripts/Sync-Py.ps1 -Lock" | |
- if: github.actor != 'renovate[bot]' | |
run: "scripts/Sync-Py.ps1" | |
- uses: "stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d" # v5.0.0 | |
with: | |
commit_message: "${{ github.actor == 'renovate[bot]' && 'Lock' || 'Sync project with template' }}" | |
lock: | |
if: github.event_name != 'pull_request' | |
permissions: | |
contents: "write" | |
needs: | |
- "ruff" | |
- "fawltydeps" | |
- "pyright" | |
- "test" | |
runs-on: "ubuntu-22.04" | |
steps: | |
- uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1 | |
with: | |
submodules: True | |
- id: "changes" | |
uses: "dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36" # v3.0.2 | |
with: | |
filters: | | |
deps: | |
- "**/pyproject.toml" | |
- "requirements/**" | |
lock: | |
- "lock.json" | |
- if: steps.changes.outputs.deps == 'true' && steps.changes.outputs.lock == 'false' | |
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0 | |
with: | |
python-version: "3.11" | |
- if: steps.changes.outputs.deps == 'true' && steps.changes.outputs.lock == 'false' | |
uses: "actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427" # v4.1.4 | |
with: | |
path: ".comps" | |
merge-multiple: True | |
- if: steps.changes.outputs.deps == 'true' && steps.changes.outputs.lock == 'false' | |
run: "scripts/Sync-Py.ps1 -Lock" | |
- if: steps.changes.outputs.deps == 'true' && steps.changes.outputs.lock == 'false' | |
uses: "stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d" # v5.0.0 | |
with: | |
commit_message: "Lock" |