Skip to content

Commit 3e8e808

Browse files
committed
ci: edit github workflows for unit tests with different versions of python
1 parent b18ac2c commit 3e8e808

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

.github/workflows/static-test-install_uv.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ jobs:
55
test-install:
66
runs-on: ubuntu-latest
77
name: basic install of compressai-vision with uv (torch cpu)
8+
strategy:
9+
matrix:
10+
python-version:
11+
- "3.8"
12+
- "3.9"
13+
- "3.10"
14+
815
steps:
916
- uses: actions/checkout@v4
1017
with:
@@ -13,9 +20,9 @@ jobs:
1320
- name: Install uv
1421
uses: astral-sh/setup-uv@v5
1522
with:
16-
python-version: '3.8'
23+
python-version: ${{ matrix.python-version }}
1724

18-
- name: install detectron2 and project with uv
25+
- name: install project with uv
1926
run: |
2027
uv pip install -U pip wheel setuptools
2128
bash scripts/install_uv.sh --no-weights --cpu -m "detectron2,yolox,segment_anything,jde"

.github/workflows/tests.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,30 @@ on:
77
pull_request:
88
branches:
99
- main
10-
10+
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version:
17+
- "3.8"
18+
- "3.9"
19+
- "3.10"
1420

1521
steps:
16-
- uses: actions/checkout@v3
17-
18-
- name: Set up Python
19-
uses: actions/setup-python@v3
22+
- uses: actions/checkout@v4
2023
with:
21-
python-version: '3.8'
24+
submodules: recursive
2225

2326
- name: Install uv
24-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
2530

26-
- name: Install dependencies
27-
run: |
28-
source $HOME/.cargo/env
29-
uv sync --group=dev
31+
- name: Install the project
32+
run: uv sync --reinstall --locked --all-extras --dev
3033

31-
- name: Run tests
32-
run: |
33-
source $HOME/.cargo/env
34-
uv run pytest
34+
- name: Run unit tests
35+
run: uv run pytest
3536

0 commit comments

Comments
 (0)