Skip to content

Commit 5d7eb56

Browse files
committed
ci: use pytest action instead of workflow
1 parent c135cff commit 5d7eb56

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

.github/workflows/python-pull-request.yml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
python-version: ["3.11"]
22+
fail-fast: false
23+
platform: ["ubuntu-latest", "macos-latest"]
24+
python-version: ["3.9", "3.10", "3.11"]
2325

2426
steps:
2527
- uses: actions/checkout@v3
@@ -46,59 +48,56 @@ jobs:
4648
run: |
4749
if [[ ${{ steps.changed-packages.outputs.training_changed }} == 'true' ]]; then
4850
echo "Installing training from local source"
49-
pip install -e ./training[tests]
51+
pip install -e ./training[all,tests]
5052
else
5153
echo "Installing training from PyPI"
52-
pip install anemoi-training[tests]
54+
pip install anemoi-training[all,tests]
5355
fi
5456
5557
- name: Install graphs package
5658
run: |
5759
if [[ ${{ steps.changed-packages.outputs.graphs_changed }} == 'true' ]]; then
5860
echo "Installing graphs from local source"
59-
pip install -e ./graphs[tests]
61+
pip install -e ./graphs[all,tests]
6062
else
6163
echo "Installing graphs from PyPI"
62-
pip install anemoi-graphs[tests]
64+
pip install anemoi-graphs[all,tests]
6365
fi
6466
6567
- name: Install models package
6668
run: |
6769
if [[ ${{ steps.changed-packages.outputs.models_changed }} == 'true' ]]; then
6870
echo "Installing models from local source"
69-
pip install -e ./models[tests]
71+
pip install -e ./models[all,tests]
7072
else
7173
echo "Installing models from PyPI"
72-
pip install anemoi-models[tests]
74+
pip install anemoi-models[all,tests]
7375
fi
7476
7577
- name: Run pytest for changed training package
7678
if: steps.changed-packages.outputs.training_changed == 'true'
77-
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
79+
uses: pavelzw/pytest-action@v2
7880
with:
79-
python-version: ${{ matrix.python-version }}
80-
install-dependencies: false
81-
custom-pytest: pytest training/tests
81+
report-title: "Test report Anemoi Training (python ${{ matrix.python-version }} on ${{ matrix.platform }})"
82+
custom-pytest: cd ./training && ${{ inputs.custom-pytest }}
8283

8384
- name: Run pytest for changed graphs package
8485
if: steps.changed-packages.outputs.graphs_changed == 'true'
85-
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
86+
uses: pavelzw/pytest-action@v2
8687
with:
87-
python-version: ${{ matrix.python-version }}
88-
install-dependencies: false
89-
custom-pytest: pytest graphs/tests
88+
report-title: "Test report Anemoi Graphs (python ${{ matrix.python-version }} on ${{ matrix.platform }})"
89+
custom-pytest: cd ./graphs && ${{ inputs.custom-pytest }}
9090

9191
- name: Run pytest for changed models package
9292
if: steps.changed-packages.outputs.models_changed == 'true'
93-
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
93+
uses: pavelzw/pytest-action@v2
9494
with:
95-
python-version: ${{ matrix.python-version }}
96-
install-dependencies: false
97-
custom-pytest: pytest models/tests
95+
report-title: "Test report Anemoi Models (python ${{ matrix.python-version }} on ${{ matrix.platform }})"
96+
custom-pytest: cd ./models && ${{ inputs.custom-pytest }}
9897

9998
- name: Run integration tests
10099
if: success()
101-
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
100+
uses: pavelzw/pytest-action@v2
102101
with:
103-
python-version: ${{ matrix.python-version }}
104-
install-dependencies: false
102+
report-title: "Test report Anemoi Core Integration (python ${{ inputs.python-version }} on ${{ matrix.platform }})"
103+
custom-pytest: pytest tests/

0 commit comments

Comments
 (0)