Skip to content

Commit 63a7747

Browse files
authored
Merge pull request #73 from ocefpaf/GHA
Use GitHub Actions for the tests
2 parents 9e4a84e + c67c59c commit 63a7747

5 files changed

Lines changed: 82 additions & 41 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Tarball tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Setup Conda
15+
uses: s-weigand/setup-conda@v1
16+
with:
17+
activate-conda: false
18+
conda-channels: conda-forge
19+
20+
- name: Create environment
21+
shell: bash -l {0}
22+
run: |
23+
conda create --name TEST python=3 python-build cython numpy --file requirements-dev.txt
24+
source activate TEST
25+
conda info --all
26+
conda list
27+
28+
- name: Tarball
29+
shell: bash -l {0}
30+
run: |
31+
source activate TEST
32+
python -m build --skip-dependencies --sdist --wheel .
33+
check-manifest --verbose
34+
twine check dist/*

.github/workflows/tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
run:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
python-version: ["3.7", "3.8", "3.9"]
14+
os: [windows-latest, ubuntu-latest, macos-latest]
15+
# Oldest one based on NEP-29 and latest one.
16+
# See https://numpy.org/neps/nep-0029-deprecation_policy.html
17+
numpy-version: ["1.17", "1.20"]
18+
exclude:
19+
- python-version: "3.9"
20+
numpy-version: "1.17"
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Setup Conda
26+
uses: s-weigand/setup-conda@v1
27+
with:
28+
activate-conda: false
29+
conda-channels: conda-forge
30+
31+
- name: Python ${{ matrix.python-version }} numpy ${{ matrix.numpy-version }}
32+
shell: bash -l {0}
33+
run: |
34+
conda create --name TEST python=${{ matrix.python-version }} python-build cython numpy=${{ matrix.numpy-version }} --file requirements-dev.txt
35+
source activate TEST
36+
pip install -e . --no-deps --force-reinstall
37+
conda info --all
38+
conda list
39+
40+
- name: Tests
41+
shell: bash -l {0}
42+
run: |
43+
source activate TEST
44+
python -c "import numpy; print(f'Running numpy {numpy.__version__}')"
45+
pytest -s -rxs -v gsw/tests

.travis.yml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,8 @@ env:
99
matrix:
1010
fast_finish: true
1111
include:
12-
- name: "py37-np116"
13-
env: PY=3.7 NUMPY=1.16
14-
- name: "py37-np119"
15-
env: PY=3.7 NUMPY=1.19
16-
- name: "py38-np116"
17-
env: PY=3.8 NUMPY=1.16
18-
- name: "py38-np119"
19-
env: PY=3.8 NUMPY=1.19
2012
- name: "docs"
2113
env: NUMPY=1 PY=3
22-
- name: "tarball"
23-
env: NUMPY=1 PY=3
2414

2515
before_install:
2616
# Install miniconda and create TEST env.
@@ -44,21 +34,6 @@ install:
4434
- pip install -e . --no-deps --force-reinstall
4535

4636
script:
47-
- |
48-
if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then
49-
python -m pep517.build --source --binary . --out-dir dist
50-
check-manifest --verbose
51-
twine check dist/*
52-
fi
53-
54-
- |
55-
if [[ $TRAVIS_JOB_NAME == py* ]]; then
56-
cp -r gsw/tests /tmp
57-
pushd /tmp
58-
pytest -s -rxs -v tests
59-
popd
60-
fi
61-
6237
- |
6338
if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then
6439
pushd docs
@@ -71,18 +46,3 @@ script:
7146
python -m doctr deploy --build-tags --key-path github_deploy_key.enc --built-docs docs/_build/html .
7247
fi
7348
fi
74-
75-
76-
deploy:
77-
skip_cleanup: true
78-
provider: pypi
79-
user: ocefpaf
80-
password:
81-
secure: aC6ZixeGhCmxdn3a4skQJHIK9Ffj/p5O1cOjHKXZh1vhHy1t5oEfk1HayWdLq2wRwODx9+Ern6ZsWRv+jiSPiqlHgOL74SHT+ByAX/WaylhhySS5JeTN+jT0vOoB7IZRtAb1QVA7mIifbrLTyHw+jX5pUt+ue1LI5zg+M9ny3E0gFYut6t3C2zbTCACmk3S5+3DXn4BT5aXJhbnF2NKTNvEzhXuL0Vu08N8pClTIQM8ZR2fniqVcM8oCPL/Ecouf7Z6L5ofl8cqdloe9e50/01XCKQs0EUWVko8XlBiKvjOUoUn3oB1rif8hahQpHIrDWNShvBqp1LE/Sxmv2FmtC0C+WAqivMqWyLOxrtZnDpk0/0DGObQ652Ypr2WocC1E2wub7rf1KinNcWmgQGIPzQbUERUYcc2yW1pRfT2oos0QLTzWgTTGlImAeuNo1s9ds7dSYcQCL6z+M0Nq3nZ71gmir22hx/j1N0OQzLBMgxz3m6+pZz6nrNT0YQTFqs/y2A6R8yf46+vySGbzoMKS0OmTmFN6Fr0URoF0oHmztb6y+aVLvHPdtfLV/ryR7DsLKXn7j1FfHoEJNoojCecgL0EZDqWiSX6wLwdTnEkZK56ZTAJGjKPFTPtfxaNLdmc+kweGhIXINp4qacWASIYBm1vldToSC2KiRo+aPKcYRaQ=
82-
distributions: sdist
83-
upload_docs: no
84-
on:
85-
repo: TEOS-10/GSW-Python
86-
tags: true
87-
all_branches: master
88-
condition: '$TRAVIS_JOB_NAME == "deploy"'

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ["pip >9.0.1", "setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "cython", "numpy"]
2+
requires = ["pip >9.0.1", "setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "cython", "oldest-supported-numpy", "build"]
33
build-backend = "setuptools.build_meta"

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ setuptools_scm
66
sphinx
77
sphinx_rtd_theme
88
twine
9+
xarray
10+
dask

0 commit comments

Comments
 (0)