-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,52 @@ | ||
name: Test min dependencies | ||
name: Run Tests with Minimum Dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: '0/10 * * * *' | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test_min_dependencies: | ||
name: Run tests with min dependencies | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
PYTHON_VERSION: "${{needs.build_info.outputs.PYTHON_MIN_VERSION}}" | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.11, 3.12] | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install toml | ||
# Generate requirements-min.txt | ||
python - <<EOF | ||
import toml | ||
with open('pyproject.toml', 'r') as f: | ||
pyproject = toml.load(f) | ||
dependencies = pyproject.get('project', {}).get('dependencies', []) | ||
with open('requirements-min.txt', 'w') as f: | ||
for dep in dependencies: | ||
dep = dep.replace('>=', '==').split(',')[0] | ||
f.write(f"{dep}\n") | ||
EOF | ||
- name: Install mrpro with minimum dependencies | ||
run: uv pip install --resolution lowest .[test] | ||
# Install minimum dependencies | ||
pip install -r requirements-min.txt | ||
- name: Run PyTest with minimum dependencies | ||
run: | | ||
pytest -n 4 -m "not cuda" --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=mrpro | tee pytest-coverage.txt | ||
- name: Install the package | ||
run: pip install . | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
- name: Run tests | ||
run: pytest | ||
|
||
# Cancel in-progress runs when a new workflow with the same group name is triggered | ||
cancel-in-progress: true | ||
- name: Cleanup | ||
run: rm requirements-min.txt |