|
10 | 10 | env: |
11 | 11 | DEFAULT_PYTHON: "3.11" |
12 | 12 |
|
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
13 | 16 | jobs: |
14 | 17 | ruff: |
15 | 18 | name: Ruff |
16 | 19 | runs-on: ubuntu-latest |
17 | 20 | steps: |
18 | 21 | - name: ⤵️ Check out code from GitHub |
19 | | - uses: actions/checkout@v4.2.2 |
20 | | - - name: 🏗 Set up Poetry |
21 | | - run: pipx install poetry |
22 | | - - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} |
23 | | - id: python |
24 | | - uses: actions/setup-python@v5.4.0 |
| 22 | + uses: actions/checkout@v5.0.0 |
| 23 | + - name: 🏗 Set up UV |
| 24 | + uses: astral-sh/setup-uv@v7.1.3 |
25 | 25 | with: |
26 | | - python-version: ${{ env.DEFAULT_PYTHON }} |
27 | | - cache: "poetry" |
28 | | - - name: 🏗 Install workflow dependencies |
29 | | - run: | |
30 | | - poetry config virtualenvs.create true |
31 | | - poetry config virtualenvs.in-project true |
32 | | - - name: 🏗 Install Python dependencies |
33 | | - run: poetry install --no-interaction |
| 26 | + enable-cache: true |
| 27 | + - name: 🏗 Install project dependencies |
| 28 | + run: uv sync --all-extras --dev |
34 | 29 | - name: 🚀 Run ruff linter |
35 | | - run: poetry run ruff check --output-format=github . |
| 30 | + run: uv run ruff check --output-format=github . |
36 | 31 | - name: 🚀 Run ruff formatter |
37 | | - run: poetry run ruff format --check . |
| 32 | + run: uv run ruff format --check . |
38 | 33 |
|
39 | | - pre-commit-hooks: |
40 | | - name: pre-commit-hooks |
| 34 | + prek-hooks: |
| 35 | + name: prek-hooks |
41 | 36 | runs-on: ubuntu-latest |
42 | 37 | steps: |
43 | 38 | - name: ⤵️ Check out code from GitHub |
44 | | - uses: actions/checkout@v4.2.2 |
45 | | - - name: 🏗 Set up Poetry |
46 | | - run: pipx install poetry |
47 | | - - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }} |
48 | | - id: python |
49 | | - uses: actions/setup-python@v5.4.0 |
| 39 | + uses: actions/checkout@v5.0.0 |
| 40 | + - name: 🏗 Set up UV |
| 41 | + uses: astral-sh/setup-uv@v7.1.3 |
50 | 42 | with: |
51 | | - python-version: ${{ env.DEFAULT_PYTHON }} |
52 | | - cache: "poetry" |
53 | | - - name: 🏗 Install workflow dependencies |
54 | | - run: | |
55 | | - poetry config virtualenvs.create true |
56 | | - poetry config virtualenvs.in-project true |
57 | | - - name: 🏗 Install Python dependencies |
58 | | - run: poetry install --no-interaction |
| 43 | + enable-cache: true |
| 44 | + - name: 🏗 Install project dependencies |
| 45 | + run: uv sync --all-extras --dev |
59 | 46 | - name: 🚀 Check Python AST |
60 | | - run: poetry run pre-commit run check-ast --all-files |
| 47 | + run: uv run prek run check-ast --all-files |
61 | 48 | - name: 🚀 Check for case conflicts |
62 | | - run: poetry run pre-commit run check-case-conflict --all-files |
| 49 | + run: uv run prek run check-case-conflict --all-files |
63 | 50 | - name: 🚀 Check docstring is first |
64 | | - run: poetry run pre-commit run check-docstring-first --all-files |
| 51 | + run: uv run prek run check-docstring-first --all-files |
65 | 52 | - name: 🚀 Check JSON files |
66 | | - run: poetry run pre-commit run check-json --all-files |
| 53 | + run: uv run prek run check-json --all-files |
67 | 54 | - name: 🚀 Check YAML files |
68 | | - run: poetry run pre-commit run check-yaml --all-files |
| 55 | + run: uv run prek run check-yaml --all-files |
69 | 56 | - name: 🚀 Detect Private Keys |
70 | | - run: poetry run pre-commit run detect-private-key --all-files |
| 57 | + run: uv run prek run detect-private-key --all-files |
71 | 58 | - name: 🚀 Check End of Files |
72 | | - run: poetry run pre-commit run end-of-file-fixer --all-files |
| 59 | + run: uv run prek run end-of-file-fixer --all-files |
73 | 60 | - name: 🚀 Trim Trailing Whitespace |
74 | | - run: poetry run pre-commit run trailing-whitespace --all-files |
| 61 | + run: uv run prek run trailing-whitespace --all-files |
0 commit comments