99 - " *"
1010 - " !v[0-9]+.[0-9]+.[0-9]+*"
1111
12+ workflow_dispatch :
13+ inputs :
14+ debug_enabled :
15+ type : boolean
16+ description : ' Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
17+ required : false
18+ default : false
19+
1220jobs :
1321
1422 pyws_setup :
@@ -101,7 +109,7 @@ jobs:
101109 pylint --jobs=2 --errors-only --exit-zero ./pywatershed ./autotest
102110
103111 test :
104- name : ${{ matrix.os}} py${{ matrix.python-version }}
112+ name : ${{ matrix.os }} py${{ matrix.python-version }}
105113 runs-on : ${{ matrix.os }}
106114 defaults :
107115 run :
@@ -112,9 +120,14 @@ jobs:
112120 os : [ "ubuntu-latest", "macos-latest", "windows-latest" ]
113121 python-version : ["3.9", "3.10"]
114122 steps :
123+
115124 - name : Checkout repo
116125 uses : actions/checkout@v3
117126
127+ - name : Setup tmate session
128+ uses : mxschmitt/action-tmate@v3
129+ if : ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
130+
118131 - name : Set environment variables
119132 run : |
120133 echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
@@ -134,11 +147,11 @@ jobs:
134147 if [[ "$MF6_REMOTE" != "$req_remote" ]]; then exit 1; fi
135148
136149 - name : Setup gfortran
137- uses : awvwgk /setup-fortran@main
150+ uses : fortran-lang /setup-fortran@v1
138151 with :
139152 compiler : gcc
140153 version : 11
141-
154+
142155 - name : Link gfortran dylibs on Mac
143156 if : runner.os == 'macOS'
144157 run : .github/scripts/symlink_gfortran_mac.sh
@@ -174,39 +187,87 @@ jobs:
174187 pip -V
175188 pip list
176189
177- - name : Run available domains with PRMS and convert csv output to NetCDF
178- working-directory : test_data/scripts
190+ - name : hru_1 - generate and manage test data domain, run PRMS and convert csv output to NetCDF
191+ working-directory : autotest
192+ run : |
193+ python generate_test_data.py \
194+ -n=auto --domain=hru_1 --remove_prms_csvs --remove_prms_output_dirs
195+
196+ - name : hru_1 - list netcdf input files
197+ working-directory : test_data
198+ run : |
199+ find hru_1/output/ -name '*.nc'
200+
201+ - name : hru_1 - pywatershed tests
202+ working-directory : autotest
203+ run : pytest
204+ -vv
205+ -n=auto
206+ --domain_yaml=../test_data/hru_1/hru_1.yaml
207+ --durations=0
208+ --cov=pywatershed
209+ --cov-report=xml
210+ --junitxml=pytest_hru_1.xml
211+
212+
213+ - name : drb_2yr - generate and manage test data
214+ working-directory : autotest
215+ run : |
216+ python generate_test_data.py \
217+ -n=auto --domain=drb_2yr --remove_prms_csvs --remove_prms_output_dirs
218+
219+ - name : drb_2yr - list netcdf input files
220+ working-directory : test_data
221+ run : |
222+ find drb_2yr/output/ -name '*.nc'
223+
224+ - name : drb_2yr - pywatershed tests
225+ working-directory : autotest
226+ run : pytest
227+ -vv
228+ -n=auto
229+ --domain_yaml=../test_data/drb_2yr/drb_2yr.yaml
230+ --durations=0
231+ --cov=pywatershed
232+ --cov-report=xml
233+ --junitxml=pytest_drb_2yr.xml
234+
235+ - name : ucb_2yr - generate and manage test data
236+ working-directory : autotest
179237 run : |
180- pytest -v -n=auto --durations=0 test_run_domains .py
181- pytest -v -n=auto --durations=0 test_nc_domains.py
238+ python generate_test_data .py \
239+ -n=auto --domain=ucb_2yr --remove_prms_csvs --remove_prms_output_dirs
182240
183- - name : List all NetCDF files in test_data directory
241+ - name : ucb_2yr - list netcdf input files
184242 working-directory : test_data
185243 run : |
186- find . -name " *.nc"
244+ find ucb_2yr/output/ -name ' *.nc'
187245
188- - name : Run tests
246+ - name : ucb_2yr - pywatershed tests
189247 working-directory : autotest
190248 run : pytest
191- -v
249+ -vv
192250 -n=auto
251+ --domain_yaml=../test_data/ucb_2yr/ucb_2yr.yaml
193252 --durations=0
194- --all_domains
195253 --cov=pywatershed
196254 --cov-report=xml
197- --junitxml=pytest .xml
255+ --junitxml=pytest_ucb_2yr .xml
198256
199257 - name : Upload test results
200258 if : always()
201- uses : actions/upload-artifact@v2
259+ uses : actions/upload-artifact@v3
202260 with :
203261 name : Test results for ${{ runner.os }}-${{ matrix.python-version }}
204- path : ./autotest/pytest.xml
262+ path : |
263+ ./autotest/pytest_hru_1.xml
264+ ./autotest/pytest_drb_2yr.xml
265+ ./autotest/pytest_ucb_2yr.xml
205266
206267 - name : Upload code coverage to Codecov
207- uses : codecov/codecov-action@v2.1.0
268+ uses : codecov/codecov-action@v3
208269 with :
209- file : ./autotest/coverage.xml
270+ file : ./autotest/coverage.xml # should be just the ucb result
210271 # flags: unittests
211272 env_vars : RUNNER_OS,PYTHON_VERSION
212273 # name: codecov-umbrella
0 commit comments