Skip to content

Commit

Permalink
chore (ci): adopt astral-sh actions
Browse files Browse the repository at this point in the history
- update the python setup to use https://github.com/astral-sh/setup-uv
  • Loading branch information
johnnv1 committed Dec 27, 2024
1 parent 196bbe9 commit 035e150
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
- name: Set up Python
uses: astral-sh/setup-uv@v5
with:
python-version: "3.11"

- name: Install dependencies
run: python -m pip install -r requirements/test.txt
run: uv pip install -r requirements/test.txt

# Update output format to enable automatic inline annotations.
- name: Run Ruff Linter
run: ruff check --output-format=github
Expand All @@ -38,22 +40,18 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install uv
python -m uv pip install --system -r requirements/required.txt -r requirements/test.txt
run: uv pip install -r requirements/required.txt -r requirements/test.txt

- name: Show installed packages
run: |
python -m pip list
run: uv pip list

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

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
Expand All @@ -67,30 +65,27 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install uv
python -m uv pip install --system -r requirements/required.txt -r requirements/test.txt
run: uv pip install -r requirements/required.txt -r requirements/test.txt
- name: Show installed packages
run: uv pip list
- name: Test with PyTest
run: RUN_SLOW=1 pytest -v -rsx -n 2 -k "logits_match"
run: RUN_SLOW=1 uv run pytest -v -rsx -n 2 -k "logits_match"

minimum:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
uses: astral-sh/setup-uv@v5
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install uv
python -m uv pip install --system -r requirements/minimum.old -r requirements/test.txt
run: uv pip install -r requirements/minimum.old -r requirements/test.txt
- name: Show installed packages
run: |
python -m pip list
run: uv pip list
- name: Test with pytest
run: pytest -v -rsx -n 2 -k "not logits_match"
run: uv run pytest -v -rsx -n 2 -k "not logits_match"

0 comments on commit 035e150

Please sign in to comment.