|
1 |
| -test: |
2 |
| - runs-on: ubuntu-latest |
3 |
| - strategy: |
4 |
| - matrix: |
5 |
| - python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 1 | +name: Shared Checks |
6 | 2 |
|
7 |
| - steps: |
8 |
| - - uses: actions/checkout@v4 |
| 3 | +on: |
| 4 | + workflow_call: |
9 | 5 |
|
10 |
| - - name: Install uv |
11 |
| - uses: astral-sh/setup-uv@v3 |
12 |
| - with: |
13 |
| - enable-cache: true |
| 6 | +jobs: |
| 7 | + format: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v4 |
14 | 11 |
|
15 |
| - - name: Install the project with the correct Python version |
16 |
| - run: uv sync --frozen --all-extras --dev --python ${{ matrix.python-version }} |
| 12 | + - name: Install uv |
| 13 | + uses: astral-sh/setup-uv@v3 |
| 14 | + with: |
| 15 | + enable-cache: true |
17 | 16 |
|
18 |
| - - name: Ensure pip is installed |
19 |
| - run: | |
20 |
| - uv run --no-sync python -m ensurepip --upgrade |
| 17 | + - name: Install the project |
| 18 | + run: uv sync --frozen --all-extras --dev --python 3.13 |
21 | 19 |
|
22 |
| - - name: Upgrade pip |
23 |
| - run: | |
24 |
| - uv run --no-sync python -m pip install --upgrade pip |
| 20 | + - name: Run ruff format check |
| 21 | + run: uv run --no-sync ruff check . |
25 | 22 |
|
26 |
| - - name: Install jose dependencies |
27 |
| - run: | |
28 |
| - uv run --no-sync python -m pip install python-jose types-python-jose |
| 23 | + typecheck: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Install uv |
| 29 | + uses: astral-sh/setup-uv@v3 |
| 30 | + with: |
| 31 | + enable-cache: true |
| 32 | + |
| 33 | + - name: Install the project |
| 34 | + run: uv sync --frozen --all-extras --dev --python 3.13 |
| 35 | + |
| 36 | + - name: Run pyright |
| 37 | + run: uv run --no-sync pyright |
| 38 | + |
| 39 | + test: |
| 40 | + runs-on: ubuntu-latest |
| 41 | + strategy: |
| 42 | + matrix: |
| 43 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 44 | + |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + |
| 48 | + - name: Install uv |
| 49 | + uses: astral-sh/setup-uv@v3 |
| 50 | + with: |
| 51 | + enable-cache: true |
| 52 | + |
| 53 | + - name: Install the project with the correct Python version |
| 54 | + run: uv sync --frozen --all-extras --dev --python ${{ matrix.python-version }} |
| 55 | + |
| 56 | + - name: Ensure pip is installed and upgraded |
| 57 | + run: | |
| 58 | + uv run --no-sync python -m ensurepip --upgrade |
| 59 | + uv run --no-sync python -m pip install --upgrade pip |
| 60 | +
|
| 61 | + - name: Install jose dependencies |
| 62 | + run: | |
| 63 | + uv run --no-sync python -m pip install python-jose types-python-jose |
| 64 | +
|
| 65 | + - name: Verify installation |
| 66 | + run: uv run --no-sync python -m pip list |
| 67 | + |
| 68 | + - name: Run pytest |
| 69 | + run: uv run --no-sync pytest |
29 | 70 |
|
30 |
| - - name: Run pytest |
31 |
| - run: uv run --no-sync pytest |
32 | 71 |
|
0 commit comments