-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (115 loc) · 3.64 KB
/
main.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
name: raven-hydro Testing Suite
on:
push:
branches:
- main
pull_request:
jobs:
black:
name: Code linting
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install pre-commit
run: |
pip install pre-commit
- name: Run linting suite
run: |
pre-commit run --all-files
build:
name: Python${{ matrix.python-version }} (${{ matrix.os }}, conda=${{ matrix.conda }}, args=${{ matrix.install_args }})
needs: black
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: ["ubuntu-latest", "macos-latest"]
conda: [false]
install_args: [""]
include:
- python-version: "3.8"
os: windows-latest
conda: true
- python-version: "3.9"
os: ubuntu-latest
conda: true
- python-version: "3.10"
os: ubuntu-latest
conda: true
- python-version: "3.10"
os: windows-latest
conda: true
- python-version: "3.10"
os: macos-latest
conda: true
- python-version: "3.11"
os: ubuntu-latest
conda: false
install_args: "-Ccmake.define.USE_NETCDF=false"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python${{ matrix.python-version }}
if: ${{ !matrix.conda }}
id: pyinstalled
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python${{ matrix.python-version }} with NetCDF4 (conda)
if: ${{ matrix.conda }}
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
cache-environment: true
environment-file: environment.yml
create-args: >-
python=${{ matrix.python-version }}
- name: Install NetCDF4 (Ubuntu/apt)
if: (matrix.os == 'ubuntu-latest') && (!matrix.install_args) && (!matrix.conda)
run: |
sudo apt-get update
sudo apt-get install libnetcdf-dev
- name: Install NetCDF4 (macOS/homebrew)
if: (matrix.os == 'macos-latest') && (!matrix.conda)
uses: tecolicom/actions-use-homebrew-tools@v1
with:
tools: netcdf
cache: yes
- name: Check for OPeNDAP Support
if: (!matrix.install_args)
run: |
nc-config --has-dap
- name: Install raven-hydro
if: ${{ !matrix.conda }}
run: |
${{ steps.pyinstalled.outputs.python-path }} -m pip install --editable . ${{ matrix.install_args }}
- name: Test raven-hydro
if: ${{ !matrix.conda }}
run: |
${{ steps.pyinstalled.outputs.python-path }} -c "import raven_hydro; print(f'raven_hydro version: {raven_hydro.__version__}')"
- name: Install raven-hydro (conda)
if: ${{ matrix.conda }}
run: |
python -m pip install --editable . ${{ matrix.install_args }}
- name: Test raven-hydro (conda)
if: ${{ matrix.conda }}
run: |
python -c "import raven_hydro; print(f'raven_hydro version: {raven_hydro.__version__}')"
- name: Test raven
run: |
raven -v