Skip to content

Commit 2791aac

Browse files
committed
chore (ci): adopt astral-sh actions
- add https://github.com/astral-sh/ruff-action for the style check - update the python setup to use https://github.com/astral-sh/setup-uv
1 parent 196bbe9 commit 2791aac

File tree

1 file changed

+14
-30
lines changed

1 file changed

+14
-30
lines changed

.github/workflows/tests.yml

+14-30
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,10 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19-
- name: Install Python
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: "3.11"
23-
- name: Install dependencies
24-
run: python -m pip install -r requirements/test.txt
19+
- uses: astral-sh/ruff-action@v2
2520
# Update output format to enable automatic inline annotations.
26-
- name: Run Ruff Linter
27-
run: ruff check --output-format=github
28-
- name: Run Ruff Formatter
29-
run: ruff format --check
21+
- run: ruff check --output-format=github
22+
- run: ruff format --check
3023

3124
test:
3225
strategy:
@@ -38,22 +31,18 @@ jobs:
3831
- uses: actions/checkout@v4
3932

4033
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v5
34+
uses: astral-sh/setup-uv@v5
4235
with:
4336
python-version: ${{ matrix.python-version }}
4437

4538
- name: Install dependencies
46-
run: |
47-
python -m pip install uv
48-
python -m uv pip install --system -r requirements/required.txt -r requirements/test.txt
39+
run: uv pip install -r requirements/required.txt -r requirements/test.txt
4940

5041
- name: Show installed packages
51-
run: |
52-
python -m pip list
42+
run: uv run python -m pip list
5343

5444
- name: Test with PyTest
55-
run: |
56-
pytest -v -rsx -n 2 --cov=segmentation_models_pytorch --cov-report=xml --cov-config=pyproject.toml -k "not logits_match"
45+
run: uv run pytest -v -rsx -n 2 --cov=segmentation_models_pytorch --cov-report=xml --cov-config=pyproject.toml -k "not logits_match"
5746

5847
- name: Upload coverage reports to Codecov
5948
uses: codecov/codecov-action@v5
@@ -67,30 +56,25 @@ jobs:
6756
steps:
6857
- uses: actions/checkout@v4
6958
- name: Set up Python
70-
uses: actions/setup-python@v5
59+
uses: astral-sh/setup-uv@v5
7160
with:
7261
python-version: "3.10"
7362
- name: Install dependencies
74-
run: |
75-
python -m pip install uv
76-
python -m uv pip install --system -r requirements/required.txt -r requirements/test.txt
63+
run: uv pip install -r requirements/required.txt -r requirements/test.txt
7764
- name: Test with PyTest
78-
run: RUN_SLOW=1 pytest -v -rsx -n 2 -k "logits_match"
65+
run: RUN_SLOW=1 uv run pytest -v -rsx -n 2 -k "logits_match"
7966

8067
minimum:
8168
runs-on: ubuntu-latest
8269
steps:
8370
- uses: actions/checkout@v4
8471
- name: Set up Python
85-
uses: actions/setup-python@v5
72+
uses: astral-sh/setup-uv@v5
8673
with:
8774
python-version: "3.9"
8875
- name: Install dependencies
89-
run: |
90-
python -m pip install uv
91-
python -m uv pip install --system -r requirements/minimum.old -r requirements/test.txt
76+
run: uv pip install -r requirements/minimum.old -r requirements/test.txt
9277
- name: Show installed packages
93-
run: |
94-
python -m pip list
78+
run: uv run python -m pip list
9579
- name: Test with pytest
96-
run: pytest -v -rsx -n 2 -k "not logits_match"
80+
run: uv run pytest -v -rsx -n 2 -k "not logits_match"

0 commit comments

Comments
 (0)