-
Notifications
You must be signed in to change notification settings - Fork 101
153 lines (134 loc) · 4.43 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: pyemu continuous integration
on:
schedule:
- cron: '0 8 * * *' # run at 8 AM UTC (12 AM PST, 8 PM NZST)
push:
pull_request:
workflow_dispatch:
jobs:
pyemuCI:
name: autotests
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest] # , macos-latest]
python-version: [3.9, "3.10", "3.11", "3.12"]
run-type: [std]
test-path: ["."]
include:
- os: macos-latest
python-version: "3.11"
steps:
- name: Checkout repo
uses: actions/checkout@v4 # checksout this repo
- name: Set Windows ENV
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
# Setup conda env
- name: Install Conda environment using micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: etc/environment.yml
environment-name: pyemu
create-args: >-
python=${{ matrix.python-version }}
cache-downloads: true
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
- name: Checkout pypestutils
uses: actions/checkout@v4
with:
repository: pypest/pypestutils
ref: develop
path: pypestutils
# - name: Install MinGW-w64 tools (Windows)
# if: runner.os == 'Windows'
# uses: msys2/setup-msys2@v2
# with:
# msystem: MINGW64
# path-type: inherit
## install: >-
## mingw-w64-x86_64-gcc-fortran
## mingw-w64-x86_64-lapack
## mingw-w64-x86_64-meson
## mingw-w64-x86_64-ninja
- name: Install meson and gfortran (for ppu)
shell: bash -l {0}
run: |
micromamba install meson gfortran
- name: Build pypestutils (Windows)
if: runner.os == 'Windows'
shell: bash -l {0}
working-directory: pypestutils
env:
LDFLAGS: -static-libgcc -static-libgfortran -static-libquadmath -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive
run: |
scripts/build_lib.sh
- name: Build pypestutils (non-Windows)
if: runner.os != 'Windows'
shell: bash -l {0}
working-directory: pypestutils
run: |
scripts/build_lib.sh
- name: Install pypestutils
shell: bash -l {0}
working-directory: pypestutils
run: |
pip install -e .
- name: Install pyemu
shell: bash -l {0}
run: |
pip install -e .
micromamba list
- name: Install Modflow executables
uses: modflowpy/install-modflow-action@v1
- name: Add executables directory to path
shell: bash
run: |
echo "$MODFLOW_BIN_PATH" >> $GITHUB_PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo $GITHUB_PATH
# order matters for this step - after setting path to executables
- name: Install PEST++ suite using get-pestpp
shell: bash -l {0}
run: |
get-pestpp :home
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.test-path }}
shell: bash -l {0}
working-directory: ./autotest
run: |
pytest -rP -rx --capture=no -v -n=auto --tb=native --cov=pyemu --cov-report=lcov ${{ matrix.test-path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test Notebooks
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == 3.10 }}
shell: bash -l {0}
working-directory: ./examples
run: |
micromamba install --name pyemu jupyter jupytext
pytest -v -rP -rx --capture=no -n=auto --nbmake --cov=pyemu --cov-report=lcov:../autotest/coverage.lcov \
--cov-config=../autotest/.coveragerc *.ipynb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.test-path }}
parallel: true
path-to-lcov: autotest/coverage.lcov
coveralls_finish:
needs: pyemuCI
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
path-to-lcov: autotest/coverage.lcov