-
Notifications
You must be signed in to change notification settings - Fork 75
176 lines (151 loc) · 6.9 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: pestpp continuous integration
on:
schedule:
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
push:
pull_request:
jobs:
pestppCI:
name: benchmarks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python-version: [3.9] # , 3.7, 3.6]
run-type: [std]
# test_repo: [""]
# test_dir: [""]
# test_script: [""]
# include:
# - test_script: opt_test.py
# - test_repo: "https://github.com/pestpp/pestpp-opt_benchmarks"
# - test_dir: "pestpp-opt_benchmarks"
env:
- { test_dir: "benchmarks", test_repo: "https://github.com/usgs/pestpp", test_script: "basic_tests.py"}
- { test_dir: "pestpp-opt_benchmarks", test_repo: "https://github.com/pestpp/pestpp-opt_benchmarks", test_script: "opt_test.py"}
- { test_dir: "pestpp-ies_benchmarks", test_repo: "https://github.com/pestpp/pestpp-ies_benchmarks", test_script: "ies_test_base.py"}
- { test_dir: "pestpp-ies_benchmarks", test_repo: "https://github.com/pestpp/pestpp-ies_benchmarks", test_script: "ies_test_part1.py"}
- { test_dir: "pestpp-ies_benchmarks", test_repo: "https://github.com/pestpp/pestpp-ies_benchmarks", test_script: "ies_test_part2.py"}
- { test_dir: "pestpp-ies_benchmarks", test_repo: "https://github.com/pestpp/pestpp-ies_benchmarks", test_script: "ies_test_part3.py"}
- { test_dir: "pestpp-ies_benchmarks", test_repo: "https://github.com/pestpp/pestpp-ies_benchmarks", test_script: "ies_test_part4.py"}
- { test_dir: "pestpp-glm_benchmarks", test_repo: "https://github.com/pestpp/pestpp-glm_benchmarks", test_script: "glm_test_base.py"}
- { test_dir: "pestpp-mou_benchmarks", test_repo: "https://github.com/pestpp/pestpp-mou_benchmarks", test_script: "mou_tests.py"}
#- { test_dir: "pestpp-mou_benchmarks", test_repo: "https://github.com/pestpp/pestpp-mou_benchmarks", test_script: "mou_tests_2.py"}
- { test_dir: "pestpp-mou_benchmarks", test_repo: "https://github.com/pestpp/pestpp-mou_benchmarks", test_script: "henry_test.py"}
- { test_dir: "pestpp-da_benchmarks", test_repo: "https://github.com/pestpp/pestpp-da_benchmarks", test_script: "da_tests.py"}
- { test_dir: "pestpp-da_benchmarks", test_repo: "https://github.com/pestpp/pestpp-da_benchmarks", test_script: "lorenz96_tests.py"}
- { test_dir: "pestpp-sqp_benchmarks", test_repo: "https://github.com/pestpp/pestpp-sqp_benchmarks", test_script: "sqp_tests.py"}
include:
- os: ubuntu-latest
env: { test_dir: "pestpp-mou_benchmarks", test_repo: "https://github.com/pestpp/pestpp-mou_benchmarks", test_script: "mou_tests_2.py"}
env: ${{ matrix.env }}
steps:
- uses: actions/[email protected]
# - name: Setup Ninja
# if: ${{ runner.os == 'Windows' }}
- uses: seanmiddleditch/gha-setup-ninja@master
# - name: Cache Miniconda
# uses: actions/[email protected]
# env:
# # Increase this value to reset cache if environment.yml has changed
# CACHE_NUMBER: 0
# with:
# path: ~/conda_pkgs_dir
# key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/environment.yml') }}
- name: Set Windows ENV
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
# Standard python fails on windows without GDAL installation
# Using custom bash shell ("shell: bash -l {0}") with Miniconda
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
# python-version: ${{ matrix.python-version }}
# #mamba-version: "0.20.0"
# channels: conda-forge
# auto-update-conda: true
# activate-environment: pyemu
# use-only-tar-bz2: true
miniforge-version: latest
# miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
# mamba-version: "*"
# channels: conda-forge
miniforge-variant: Mambaforge
# auto-update-conda: true
activate-environment: pyemu
use-mamba: true
# environment-file: etc/environment.yml
# use-only-tar-bz2: true
# - name: Add packages to pyemu environment using mamba or conda
# shell: bash -l {0}
# run: |
# if [ "$RUNNER_OS" == "Windows" ]; then
# conda env update --name pyemu --file etc/environment.yml
# else
# conda env update --name pyemu --file etc/environment.yml
# fi
- name: Add packages to pyemu environment using conda
if: ${{ matrix.python-version < 3.8 }}
# if: ${{ runner.os == 'Windows' || matrix.python-version < 3.8 }}
shell: bash -l {0}
run: |
conda env update --name pyemu --file etc/environment.yml
- name: Add packages to pyemu environment using mamba
# if: ${{ runner.os != 'Windows' && matrix.python-version >= 3.8 }}
if: ${{ matrix.python-version >= 3.8 }}
shell: bash -l {0}
run: |
mamba env update --name pyemu --file etc/environment.yml
- name: Install Flopy & pyemu?
shell: bash -l {0}
run: |
# git clone -b develop --depth 1 https://github.com/modflowpy/flopy.git
# cd flopy
# python setup.py install
# cd ..
# pip install https://github.com/modflowpy/pymake/zipball/master
git clone -b develop --depth 1 https://github.com/pypest/pyemu.git
cd pyemu
python setup.py install
cd ..
# - name: Get specific version CMake, v3.19
# if: ${{ runner.os == 'Windows' }}
# uses: lukka/get-cmake@latest
- name: clone test repo ${{ env.test_repo }}
shell: bash -l {0}
run: |
git clone ${{ env.test_repo }}
- name: PESTPP exe install
shell: bash -l {0}
run: |
mkdir build && cd build
if [[ "$RUNNER_OS" == "Windows" ]]; then
cmake -GNinja -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Release ..
ninja
else
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j2
fi
cd ..
- name: aux bin path hackery
shell: bash -l {0}
run: |
cp -r benchmarks/test_bin/win $HOME/bin
echo "../../test_bin/win" >> $GITHUB_PATH
if [[ "$RUNNER_OS" == "Windows" ]]; then
cp -r benchmarks/test_bin/win $HOME/bin
echo "../../test_bin/win" >> $GITHUB_PATH
else
echo "../../test_bin/linux" >> $GITHUB_PATH
cp -r benchmarks/test_bin/win $HOME/bin
fi
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: run test script ${{ env.test_script }} in ${{ env.test_dir }}
shell: bash -l {0}
run: |
ls -l
cd ${{ env.test_dir }}
nosetests -v ${{ env.test_script }}
cd