-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (77 loc) · 2.58 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
name: gsflow continuous integration
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
pygsflowCI:
name: autotests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.8, "3.10"]
run-type: [std]
test-pth: ["./autotest"]
defaults:
run:
shell: bash
steps:
- name: Checkout pygsflow repo
uses: actions/[email protected]
- name: Get branch name
uses: nelonoel/[email protected]
- 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: Setup Miniconda
uses: conda-incubator/[email protected]
with:
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge
auto-update-conda: true
activate-environment: pygsflow
use-only-tar-bz2: true
- name: Add packages to pygsflow environment using mamba or conda
shell: bash -l {0}
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
conda env update --name pygsflow --file etc/environment.yml
else
mamba env update --name pygsflow --file etc/environment.yml
fi
- name: Install pymake, flopy, and pygsflow
shell: bash -l {0}
run: |
pip install https://github.com/modflowpy/pymake/zipball/master
pip install https://github.com/modflowpy/flopy/zipball/develop
pip install https://github.com/pygsflow/pygsflow/zipball/develop
- name: Setup symbolic link to gfortran on Linux
if: runner.os == 'Linux'
run: |
sudo ln -fs /usr/bin/gfortran-10 /usr/bin/gfortran
sudo ln -fs /usr/bin/gcc-10 /usr/bin/gcc
sudo ln -fs /usr/bin/g++-10 /usr/bin/g++
- name: Print GNU compiler versions
run: |
gfortran --version
gcc --version
g++ --version
- name: Run nosetest CI testing suite for GSFLOW
shell: bash -l {0}
run: |
cd autotest
chmod u+x make_linux_gfortran.sh
sed -i -e 's/\r$//' make_linux_gfortran.sh
./make_linux_gfortran.sh
chmod a+x gsflow
pip install pytest
pytest -v