Run tests with newest and oldest dependencies #2
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 dependencies" | |
on: | |
workflow_dispatch | |
jobs: | |
run-tests: | |
name: Run tests 🛠️ on multiple systems 🖥️ and Python 🐍 versions | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.9", "3.10", "3.11"] | |
include: | |
- os: macos-latest | |
python-version: "3.11" | |
- os: windows-latest | |
python-version: "3.11" | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 newest dependencies | |
run: pdm lock --lockfile pdm.newest.lock | |
- name: Export requirements file | |
run: pdm export -G test -f requirements -o requirements.newest.txt --self --lockfile pdm.newest.lock | |
- name: Install srai and tests dependencies | |
run: pip install --no-deps -r requirements.newest.txt | |
- name: Run tests with pytest | |
run: pytest -v --durations=20 tests |