forked from ecmwf/anemoi-core
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 1.96 KB
/
python-pull-request.yml
File metadata and controls
69 lines (58 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Code Quality and Testing
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
schedule:
- cron: "9 2 * * 0" # at 9:02 on sunday
workflow_dispatch:
merge_group:
env:
UV_SYSTEM_PYTHON: 1
jobs:
quality:
uses: ecmwf/reusable-workflows/.github/workflows/qa-precommit-run.yml@v2
with:
skip-hooks: "no-commit-to-branch"
pytest:
strategy:
fail-fast: false
matrix:
platform: ["ubuntu-latest"]
python-version: ["3.10", "3.11", "3.12"]
runs-on: ${{ matrix.platform }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: 0.7.19 # use same version as the one in ecmwf/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml
- name: Install packages
run: |
# Install all packages from local
uv pip install -e ./training[all,tests] -e ./graphs[all,tests] -e ./models[all,tests] pytest pytest-md pytest-emoji
- name: Run pytest for training package
uses: pavelzw/pytest-action@v2
with:
report-title: "Test report Anemoi Training (python ${{ matrix.python-version }} on ${{ matrix.platform }})"
custom-pytest: pytest ./training
- name: Run pytest for graphs package
uses: pavelzw/pytest-action@v2
with:
report-title: "Test report Anemoi Graphs (python ${{ matrix.python-version }} on ${{ matrix.platform }})"
custom-pytest: pytest ./graphs
- name: Run pytest for models package
uses: pavelzw/pytest-action@v2
with:
report-title: "Test report Anemoi Models (python ${{ matrix.python-version }} on ${{ matrix.platform }})"
custom-pytest: pytest ./models