Skip to content

Commit

Permalink
fix: make the lowest-dependencies platform configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau committed Nov 15, 2024
1 parent f01b4e5 commit 8edf6fa
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ on:
default: '["3.10", "3.11", "3.12", "3.13"]'
description: |
The python versions to run fast tests on, as a JSON array.
lowest-python-version:
type: string
description: |
The Python version to run when using "lowest" resolution for tests.
slow-test-platforms:
type: string
default: '["jammy"]'
Expand All @@ -26,6 +22,16 @@ on:
default: '["3.10"]'
description: |
The python versions to run slow tests on, as a JSON array.
lowest-python-platform:
type: string
description: |
The platform to run the lowest python version tests on.
default: "ubuntu-20.04"
lowest-python-version:
type: string
description: |
The Python version to run when using "lowest" resolution for tests.
default: "3.10"

jobs:
fast:
Expand Down Expand Up @@ -74,13 +80,15 @@ jobs:
path: |
./coverage.xml
htmlcov/**
lowest:
name: Minimum dependencies (all tests)
if: ${{ inputs.lowest-python-version }} != ''
runs-on: jammy
slow:
name: Slow tests
strategy:
matrix:
platform: ${{ fromJson(inputs.slow-test-platforms) }}
python-version: ${{ fromJson(inputs.slow-test-python-versions) }}
runs-on: ${{ matrix.platform }}
env:
UV_PYTHON: ${{ inputs.lowest-python-version }}
UV_RESOLUTION: lowest
PYTEST_ADDOPTS: --no-header -v -rN -m 'slow'
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -90,7 +98,7 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: lowest-jammy
cache-suffix: ${{ toJSON(matrix.platform) }}
- name: Install tools
run: |
make setup-tests
Expand All @@ -100,20 +108,18 @@ jobs:
- name: Upload test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-lowest-py${{ inputs.lowest-python-version }}
name: coverage-slow-${{ matrix.platform }}-${{ matrix.python-version }}
overwrite: true
path: |
./coverage.xml
htmlcov/**
slow:
name: Slow tests
strategy:
matrix:
platform: ${{ fromJson(inputs.slow-test-platforms) }}
python-version: ${{ fromJson(inputs.slow-test-python-versions) }}
runs-on: ${{ matrix.platform }}
lowest:
name: Minimum dependencies (all tests)
if: ${{ inputs.lowest-python-version }} != ''
runs-on: ${{ inputs.lowest-python-platform }}
env:
PYTEST_ADDOPTS: --no-header -v -rN -m 'slow'
UV_PYTHON: ${{ inputs.lowest-python-version }}
UV_RESOLUTION: lowest
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -123,7 +129,7 @@ jobs:
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-suffix: ${{ toJSON(matrix.platform) }}
cache-suffix: lowest-jammy
- name: Install tools
run: |
make setup-tests
Expand All @@ -133,8 +139,9 @@ jobs:
- name: Upload test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-slow-${{ matrix.platform }}-${{ matrix.python-version }}
name: coverage-lowest-py${{ inputs.lowest-python-version }}
overwrite: true
path: |
./coverage.xml
htmlcov/**

0 comments on commit 8edf6fa

Please sign in to comment.