-
Notifications
You must be signed in to change notification settings - Fork 5
99 lines (84 loc) · 2.76 KB
/
gsw-python.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
name: Python tests using GSW-rs
on:
push:
branches: [main]
pull_request:
jobs:
test_py_api:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v2
with:
repository: "TEOS-10/GSW-Python"
ref: dc77e960ee1b615b83973536a6a8c9e87f2e4aae
- uses: actions/checkout@v2
with:
path: 'src/GSW-rs'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Get Rust Version
id: rust-version
run: echo "::set-output name=version::$(cargo -V | head -n1 | awk '{print $2}')"
- uses: actions/cache@v2
with:
path: |
~/.cargo/git
~/.cargo/registry
target
key: ${{ runner.os }}-cargo-${{ steps.rust-version.outputs.version }}
- name: Install cargo-c (linux)
if: startsWith(matrix.os, 'ubuntu')
env:
LINK: https://github.com/lu-zero/cargo-c/releases/download
CARGO_C_VERSION: 0.8.0
run: |
curl -L "$LINK/v$CARGO_C_VERSION/cargo-c-linux.tar.gz" |
tar xz -C $HOME/.cargo/bin
- name: Install cargo-c (macos)
if: startsWith(matrix.os, 'macos')
env:
LINK: https://github.com/lu-zero/cargo-c/releases/download
CARGO_C_VERSION: 0.8.0
run: |
curl -LO "$LINK/v$CARGO_C_VERSION/cargo-c-macos.zip"
7z e -y "cargo-c-macos.zip" -o$HOME/.cargo/bin
- name: Install cargo-c (win)
if: startsWith(matrix.os, 'windows')
run: |
$LINK = "https://github.com/lu-zero/cargo-c/releases/download/v0.8.0"
$CARGO_C_FILE = "cargo-c-windows-msvc"
curl -LO "$LINK/$CARGO_C_FILE.zip"
7z e -y "$CARGO_C_FILE.zip" -o"${env:USERPROFILE}\.cargo\bin"
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest xarray dask
- name: Install patched GSW-Python
run: |
git apply src/GSW-rs/utils/gsw-py-patch
pip install .
- name: Run pytest
continue-on-error: true
run: |
pytest -s -rxs -v gsw/tests