Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: CI

env:
RUFF_UNRELEASED_REF: 'main'

on:
push:
branches: [main]
Expand Down Expand Up @@ -45,29 +48,33 @@ jobs:
)
# Get the oldest supported version from the pyproject.toml
OLDEST=$(rg -No '"ruff>=(.*)"' -r '$1' pyproject.toml)
UNRELEASED=${{ env.RUFF_UNRELEASED_REF }}

echo "::set-output name=versions::[\"$OLDEST\", \"$LATEST\"]"
echo "::set-output name=oldest::$OLDEST
echo "::set-output name=latest::$LATEST
echo "::set-output name=latest::$LATEST"
echo "::set-output name=oldest::$OLDEST"
echo "::set-output name=dev::$UNRELEASED"
outputs:
versions: ${{ steps.set-versions.outputs.versions }}
oldest: ${{ steps.set-versions.outputs.oldest }}
latest: ${{ steps.set-versions.outputs.latest }}
oldest: ${{ steps.set-versions.outputs.oldest }}
dev: ${{ steps.set-versions.outputs.dev }}

test:
name: Test (python-${{ matrix.python-version }}, ruff-${{ matrix.ruff-version }}, ${{ matrix.os }})
needs: ruff-versions
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
ruff-version: ${{ fromJson(needs.ruff-versions.outputs.versions) }}
os: [ubuntu-latest, macos-latest, windows-latest]

exclude:
- os: windows-latest
ruff-version: ${{ needs.ruff-versions.outputs.oldest }}
- os: macos-latest
ruff-version: ${{ needs.ruff-versions.outputs.oldest }}
include:
- ruff-version: ${{ needs.ruff-versions.outputs.latest }}
- ruff-version: ${{ needs.ruff-versions.outputs.oldest }}
os: ubuntu-latest
python-version: "3.7"
- ruff-version: ${{ needs.ruff-versions.outputs.dev }}
os: ubuntu-latest
python-version: "3.12"

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -79,9 +86,24 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: just install
- name: Install test Ruff version
run: pip install ruff==${{ matrix.ruff-version }}
run: |
pip install -U pip
just install

- name: Install test Ruff version from PyPI
if: ${{ matrix.ruff-version != env.RUFF_UNRELEASED_REF }}
run: |
pip install ruff==${{ matrix.ruff-version }}
ruff --version

- name: "Install test Ruff version from GitHub"
if: ${{ matrix.ruff-version == env.RUFF_UNRELEASED_REF }}
run: |
pip install --force-reinstall git+https://github.com/astral-sh/ruff@${{ matrix.ruff-version }}
pip show ruff
ruff version

- name: Run tests
run: just test