|
1 | 1 | name: pre-merge |
2 | 2 |
|
3 | | -env: |
4 | | - REGISTRY: ghcr.io |
5 | | - IMAGE_NAME: ${{ github.repository }} |
6 | | - |
7 | 3 | on: |
8 | 4 | pull_request: |
9 | 5 | workflow_dispatch: |
10 | 6 |
|
11 | 7 | jobs: |
12 | | - pre-merge: |
| 8 | + lint: |
13 | 9 | runs-on: ubuntu-24.04 |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v4 |
| 12 | + - name: Install uv |
| 13 | + uses: astral-sh/setup-uv@v5 |
| 14 | + with: |
| 15 | + enable-cache: true |
| 16 | + - name: Install dependencies |
| 17 | + run: uv sync --locked |
| 18 | + - name: Ruff (format) |
| 19 | + run: uv run ruff format --check |
| 20 | + - name: Ruff (lint) |
| 21 | + run: uv run ruff check |
| 22 | + - name: ty (type check) |
| 23 | + run: uv run ty check |
| 24 | + |
| 25 | + test: |
| 26 | + runs-on: ubuntu-latest |
14 | 27 | strategy: |
| 28 | + fail-fast: false |
15 | 29 | matrix: |
16 | | - python-version: ["3.10", "3.12"] |
17 | | - include: |
18 | | - - python-version: "3.10" |
19 | | - python-py-version: "py310" |
20 | | - - python-version: "3.12" |
21 | | - python-py-version: "py312" |
22 | | - container: |
23 | | - image: ghcr.io/${{ github.repository }}-ci:${{ matrix.python-py-version }}-poetry-bullseye |
24 | | - credentials: |
25 | | - username: ${{ github.actor }} |
26 | | - password: ${{ secrets.GITHUB_TOKEN }} |
27 | | - |
| 30 | + python-version: ["3.10", "3.12", "3.14"] |
28 | 31 | steps: |
29 | 32 | - uses: actions/checkout@v4 |
30 | | - - name: Poetry Venv Dir |
31 | | - run: | |
32 | | - echo "VENV_DIR=$(poetry config virtualenvs.path)" >> $GITHUB_ENV |
33 | | -
|
34 | | - - name: Restore the Cache |
35 | | - id: cache-deps |
36 | | - uses: actions/cache@v4 |
| 33 | + - name: Install uv |
| 34 | + uses: astral-sh/setup-uv@v5 |
37 | 35 | with: |
38 | | - path: ${{ env.VENV_DIR }} |
39 | | - # bump the suffix if you need to force-refresh the cache |
40 | | - key: py-trees-ci-cache-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock', '**/tox.ini') }}-1 |
41 | | - |
42 | | - # Install all deps, sans the project (--no-root) |
43 | | - - name: Poetry - Install Dependencies |
44 | | - run: poetry install --no-interaction --no-root |
45 | | - if: steps.cache-deps.outputs.cache-hit != 'true' |
46 | | - |
47 | | - # Project is installed separately to avoid always invalidating the cache |
48 | | - - name: Poetry - Install Project |
49 | | - run: poetry install --no-interaction |
50 | | - |
51 | | - # TODO: Caching above doesn't make much sense when tox effectively re-installs deps |
52 | | - - name: Tox - Tests |
53 | | - run: poetry run tox --workdir ${{ env.VENV_DIR }} -e ${{ matrix.python-py-version }} |
54 | | - - name: Tox - Formatters, Linters |
55 | | - run: poetry run tox --workdir ${{ env.VENV_DIR }} -e check |
56 | | - - name: Tox - MyPy |
57 | | - run: poetry run tox --workdir ${{ env.VENV_DIR }} -e my${{ matrix.python-py-version }} |
| 36 | + enable-cache: true |
| 37 | + - name: Install dependencies |
| 38 | + run: uv sync --locked --python ${{ matrix.python-version }} |
| 39 | + - name: Pytest |
| 40 | + run: uv run --python ${{ matrix.python-version }} pytest -s --cov=py_trees tests/ |
0 commit comments