Run tests with newest and oldest dependencies #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Run tests with newest and oldest dependencies" | |
on: | |
workflow_dispatch: | |
workflow_call: | |
schedule: | |
- cron: "0 4 * * 1" # every monday at 04:00 UTC | |
jobs: | |
run-tests-newest: | |
name: Run tests 🛠️ on multiple systems 🖥️ and Python 🐍 versions (newest dependencies) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
include: | |
- os: macos-latest | |
python-version: "3.12" | |
- os: macos-13 | |
python-version: "3.12" | |
- os: windows-latest | |
python-version: "3.12" | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
COLUMNS: 120 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pdm | |
run: pip install pdm uv | |
- name: Generate requirements.txt | |
run: pdm export -dG test -f requirements -o requirements.test.txt | |
- name: Install quackosm | |
run: | | |
uv pip install -e "quackosm[cli] @ ." -r requirements.test.txt --system | |
- name: Run tests with pytest | |
run: | | |
pytest -v -s --durations=20 --doctest-modules --doctest-continue-on-failure quackosm | |
pytest -v -s --durations=20 tests/base | |
pytest -v -s --durations=20 tests/optional_imports | |
run-tests-oldest: | |
name: Run tests 🛠️ on multiple systems 🖥️ and Python 🐍 versions (oldest dependencies) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-13, macos-latest, windows-latest] | |
python-version: ["3.9"] | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
COLUMNS: 120 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install pdm | |
run: pip install pdm | |
- name: Generate lock with oldest dependencies | |
run: | | |
echo "fiona==1.9.6" >> fiona_constraint.txt | |
pdm lock --override fiona_constraint.txt --lockfile pdm.oldest.lock --strategy no_cross_platform,direct_minimal_versions -G cli -dG test | |
- name: Install quackosm and tests dependencies | |
run: pdm install --lockfile pdm.oldest.lock -G cli -dG test --skip=post_install | |
- name: Run tests with pytest | |
run: | | |
pdm run pytest -v -s --durations=20 tests/base | |
pdm run pytest -v -s --durations=20 tests/optional_imports |