-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add separate windows workflow that uses miniconda (#1324)
- Loading branch information
1 parent
2eeaf1d
commit 831771d
Showing
2 changed files
with
136 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
name: flopy Windows CI | ||
|
||
on: | ||
schedule: | ||
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST) | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
- 'release*' | ||
pull_request: | ||
branches: [master, develop] | ||
|
||
jobs: | ||
|
||
flopy_setup: | ||
name: standard installation | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
steps: | ||
|
||
# check out repo | ||
- name: Checkout flopy repo | ||
uses: actions/checkout@v2.3.4 | ||
|
||
- name: Setup Python 3.9 | ||
uses: actions/setup-python@v2.2.2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Upgrade pip and install wheel | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
- name: Base flopy installation | ||
run: | | ||
pip install . --use-feature=in-tree-build | ||
- name: Print flopy version | ||
run: | | ||
python -c "import flopy; print(flopy.__version__)" | ||
flopyCI_windows: | ||
name: autotests | ||
needs: [flopy_setup] | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.9, 3.8, 3.7] | ||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
steps: | ||
# check out repo | ||
- name: Checkout flopy repo | ||
uses: actions/checkout@v2.3.4 | ||
|
||
- name: Get branch name | ||
uses: nelonoel/branch-name@v1.0.1 | ||
|
||
- name: Cache Miniconda | ||
uses: actions/cache@v2.1.0 | ||
env: | ||
# Increase this value to reset cache if environment.yml has changed | ||
CACHE_NUMBER: 3 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/environment.yml') }} | ||
|
||
# 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.1.1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
channels: conda-forge | ||
auto-update-conda: true | ||
activate-environment: flopy | ||
use-only-tar-bz2: true | ||
|
||
- name: Add packages to flopy environment using conda | ||
run: | | ||
conda env update --name flopy --file etc/environment.yml | ||
- name: Upgrade pip and install wheel | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
- name: Install pymake, xmipy, and flopy | ||
run: | | ||
pip install https://github.com/modflowpy/pymake/zipball/master | ||
pip install xmipy | ||
pip install . --use-feature=in-tree-build | ||
- name: Prepare for the autotests | ||
working-directory: ./autotest | ||
run: | | ||
pytest -v ci_prepare.py | ||
# - name: Add executables directory to path on Windows (bash) | ||
# run: | | ||
# echo "C:\Users\runneradmin\.local\bin" >> $GITHUB_PATH | ||
|
||
- name: Add executables directory to path on Windows (pwsh) | ||
run: | | ||
echo "C:\Users\runneradmin\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Run pytest on autotest scripts | ||
working-directory: ./autotest | ||
run: | | ||
pytest -v -n auto --durations=0 --cov=flopy --cov-report=xml | ||
- name: Print coverage report before upload | ||
working-directory: ./autotest | ||
run: | | ||
coverage report | ||
- name: Upload coverage to Codecov | ||
if: | ||
github.repository_owner == 'modflowpy' && github.event_name == 'push' | ||
uses: codecov/codecov-action@v2.1.0 | ||
with: | ||
directory: ./autotest | ||
file: coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters