-
Notifications
You must be signed in to change notification settings - Fork 11
75 lines (72 loc) · 2.15 KB
/
ci.yml
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
70
71
72
73
74
75
name: Run Python Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: build (${{ matrix.os }}, ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install / build
run: |
python -m pip install --upgrade pip
pip install .
test:
name: pytest (${{ matrix.os }}, ${{ matrix.python-version }}, packages version ${{ matrix.version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
poetry-version: ["1.3.2"]
version: ["lock"]
include:
- python-version: "3.9"
version: "minimal"
os: "ubuntu-latest"
poetry-version: "1.3.2"
- python-version: "3.12"
version: "maximal"
os: "ubuntu-latest"
poetry-version: "1.3.2"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python 3
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: update lock file
if: matrix.version == 'maximal'
run: poetry update
- name: Install dependencies
run: |
poetry install --with test
- name: use minimal versions for lock file
if: matrix.version == 'minimal'
run: |
pipx install pdm==2.15.2
poetry add 'numpy<2'
poetry run pdm lock --strategy direct_minimal_versions -v -G :all
poetry run pdm install -v -G :all
- name: Run tests with pytest
run: poetry run pytest xnemogcm/test