Skip to content

Commit 5125653

Browse files
committed
Use astral-sh/ruff-action@v2
1 parent 231972d commit 5125653

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

.github/workflows/lint-and-build.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,20 @@ concurrency:
4040

4141
jobs:
4242
ruff:
43-
runs-on: ${{ matrix.os }}
44-
strategy:
45-
fail-fast: false
46-
# Ruff is version and platform sensible
47-
matrix:
48-
os: [windows-latest, ubuntu-22.04]
49-
python-version: ["3.11", "3.12", "3.13"]
43+
runs-on: ubuntu-22.04
5044
steps:
5145
- name: Checkout ${{ github.repository }}/${{ github.ref }}
5246
uses: actions/checkout@v4
53-
- name: Set up Python ${{ matrix.python-version }}
54-
uses: actions/setup-python@v5
55-
with:
56-
python-version: ${{ matrix.python-version }}
57-
cache: "pip"
58-
cache-dependency-path: "scripts/requirements*.txt"
59-
- run: scripts/install.ps1
47+
- name: Get Ruff version
48+
id: ruff_version
49+
run: |
50+
$Env:RUFF_VERSION=Select-String -path scripts/requirements-dev.txt -pattern 'ruff ?([=<>~]?= ?[\d\.]+)' | %{ $_.Matches[0].Groups[1].Value }
51+
echo $Env:RUFF_VERSION
52+
echo "RUFF_VERSION=$Env:RUFF_VERSION" >> $Env:GITHUB_OUTPUT
6053
shell: pwsh
61-
- run: ruff check .
54+
- uses: astral-sh/ruff-action@v2
55+
with:
56+
version: ${{ steps.ruff_version.outputs.RUFF_VERSION }}
6257
Pyright:
6358
runs-on: ${{ matrix.os }}
6459
strategy:

scripts/requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
-r requirements.txt
1313
#
1414
# Linters & Formatters
15-
ruff>=0.8.0 # Pre-commit fix # Must match .pre-commit-config.yaml
15+
ruff>=0.8.0
1616
#
1717
# Types
1818
scipy-stubs>=1.14.1.1

0 commit comments

Comments
 (0)