-
Notifications
You must be signed in to change notification settings - Fork 4
100 lines (82 loc) · 2.04 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI
on:
push:
paths-ignore:
- '**.md'
- '.gitignore'
pull_request:
branches:
- main
- develop
paths-ignore:
- '**.md'
- '.gitignore'
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: 'pip'
cache-dependency-path: pyproject.toml
- name: Install Python packages
run: pip install ".[lint]"
- name: Linter
run: ruff check .
- name: Formatter
run: ruff format --check
# TODO: enable when passing
# - name: Type checker
# run: mypy flopy4
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install Python packages
run: |
pip install --upgrade pip
pip install build twine
pip --verbose install .
- name: Print package version
run: python -c "from flopy4 import version; print(version.__version__)"
- name: Build package
run: python -m build
test:
name: Test
needs:
- build
- lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-12, windows-2022 ]
python: [ 3.9, "3.10", "3.11", "3.12" ]
env:
GCC_V: 11
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install nightly build
uses: modflowpy/install-modflow-action@v1
with:
repo: modflow6-nightly-build
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Python packages
run: pip install ".[test]"
- name: Run tests
run: pytest -v -n auto