Skip to content

Commit e8a8e37

Browse files
committed
Run all the tests on GHA
1 parent 0302cfa commit e8a8e37

9 files changed

Lines changed: 166 additions & 150 deletions

File tree

.appveyor.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
packages:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.8
18+
19+
- name: Get tags
20+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
21+
shell: bash
22+
23+
- name: Install build tools
24+
run: |
25+
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine pytest pandas pytz requests
26+
27+
shell: bash
28+
29+
- name: Build binary wheel
30+
run: python -m build --sdist --wheel . --outdir dist
31+
32+
- name: CheckFiles
33+
run: |
34+
ls dist
35+
shell: bash
36+
37+
- name: Test wheels
38+
run: |
39+
cd dist && python -m pip install erddapy*.whl
40+
python -m twine check *
41+
shell: bash
42+
43+
- name: Publish a Python distribution to PyPI
44+
uses: pypa/gh-action-pypi-publish@master
45+
with:
46+
user: __token__
47+
password: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/test_code.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,39 @@
11
name: Code Tests
22

33
on:
4-
push:
5-
branches:
6-
- master
74
pull_request:
8-
branches:
9-
- master
5+
push:
6+
branches: [master]
107

118
jobs:
129
run:
1310
runs-on: ${{ matrix.os }}
1411
strategy:
1512
matrix:
16-
os: [ubuntu-latest, windows-latest]
17-
python-version: [3.6, 3.9]
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
python-version: ["3.6", "3.7", "3.8", "3.9"]
1815

1916
steps:
2017
- uses: actions/checkout@v2
2118

2219
- name: Setup Conda
2320
uses: s-weigand/setup-conda@v1
2421
with:
22+
update-conda: true
2523
activate-conda: false
2624
conda-channels: conda-forge
2725

2826
- name: Python ${{ matrix.python-version }}
2927
shell: bash -l {0}
3028
run: |
31-
conda create --yes --name TEST python=${{ matrix.python-version }} pip --file requirements.txt --file requirements-dev.txt --channel conda-forge --strict-channel-priority
29+
conda create --name TEST python=${{ matrix.python-version }} pip --file requirements.txt --file requirements-dev.txt
3230
source activate TEST
3331
pip install -e . --no-deps --force-reinstall
34-
35-
- name: Tarball tests
36-
shell: bash -l {0}
37-
run: |
38-
source activate TEST
39-
pip wheel . -w dist --no-deps
40-
check-manifest --verbose
41-
twine check dist/*
32+
conda info --all
33+
conda list
4234
4335
- name: Tests
4436
shell: bash -l {0}
4537
run: |
4638
source activate TEST
47-
pytest -vv
39+
pytest -vv -rxs tests -m "not headless"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Notebook Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Setup Conda
16+
uses: s-weigand/setup-conda@v1
17+
with:
18+
update-conda: true
19+
activate-conda: false
20+
conda-channels: conda-forge
21+
22+
- name: Python 3.9
23+
shell: bash -l {0}
24+
run: |
25+
conda create --name TEST python=3.9 pip --file requirements.txt --file requirements-dev.txt
26+
source activate TEST
27+
pip install -e . --no-deps --force-reinstall
28+
conda info --all
29+
conda list
30+
31+
- name: Notebook tests
32+
shell: bash -l {0}
33+
run: |
34+
source activate TEST
35+
pytest --nbval-lax examples
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Headless Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Setup Conda
16+
uses: s-weigand/setup-conda@v1
17+
with:
18+
update-conda: true
19+
activate-conda: false
20+
conda-channels: conda-forge
21+
22+
- name: Python 3.9
23+
shell: bash -l {0}
24+
run: |
25+
conda create --name TEST python=3.9 pip --file requirements.txt --file requirements-dev.txt
26+
source activate TEST
27+
pip install -e . --no-deps --force-reinstall
28+
conda info --all
29+
conda list
30+
31+
- name: Tests
32+
shell: bash -l {0}
33+
run: |
34+
source activate TEST
35+
pytest -vv -rxs tests -m "headless"

.github/workflows/test_tarball.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Setup Conda
16+
uses: s-weigand/setup-conda@v1
17+
with:
18+
update-conda: true
19+
activate-conda: false
20+
conda-channels: conda-forge
21+
22+
- name: Python 3
23+
shell: bash -l {0}
24+
run: |
25+
conda create --name TEST python=3 pip --file requirements.txt --file requirements-dev.txt
26+
source activate TEST
27+
pip install -e . --no-deps --force-reinstall
28+
conda info --all
29+
conda list
30+
31+
- name: Tarball tests
32+
shell: bash -l {0}
33+
run: |
34+
source activate TEST
35+
pip wheel . -w dist --no-deps
36+
check-manifest --verbose
37+
twine check dist/*

.travis.yml

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,17 @@ language: minimal
22

33
sudo: false
44

5-
env:
6-
- MOZ_HEADLESS=1
7-
8-
addons:
9-
apt:
10-
packages:
11-
# Without libgtk (as of 2019-11-6), firefox cannot run properly
12-
- libgtk-3-0
13-
firefox: latest
14-
155
env:
166
global:
177
- secure: "JrdAJJKe+Y564LIiIaGPmw9X9utvj2lVI2MkVyZX6CQ7cJwqPUB+ukZpa6MnGUEJSoI6S7/5ZqX/cvciVAKpcYadi/snlDGq6q+lLnA+6rtB6ppy99Ib64aqm+VqDyohvvvrNtSxqhBY48DLG9UuQEcvviabpx9CG4s439/osspsA80SRXgDm/dELjU8vuIJvL1EFPeOu4a01sAHsqhknQw4F4YSWWjUr1oNjZIhSKroxCJV0o/0ok600SwTrQrbwJNO8QmEBOTw1JO1kaxDRlMAsJ5JTBaeGWdhqWQ3IRH/RogkU3ukOyyybbeoWU9ou5xG08P0r4CM3dGh44M8qrTOOCUSSNrFIG5OhAW6ZdkSR/2w76fNnW6y25jKUQ2444kd8n8+TObsp8aNl1FkCwou6/SpPluKvtaFA+I1zbk8roG58tW9anf6o9zCdIyYhSFysEoKNNihSC6xc4zHlJUHWr61f4zC0mU1Xf/djgpvj2YUQLsQ4++K6FNb6I/CN7LDl67kkOiyVCKv60J1mHVXAPJpj2Y9SxR87ob+GH+na8oFy5IMPMDoym2hPImtl2cjGvpP6RvE+gVE+mfvc4BizWfsR1zO49DUD15U1Y6jqhbcPMCgk5FoQ3ZKiH6LBeFbmV0qMjwSC6pZONgz8s/2nTUMV3VU+9SBiah51ho="
188

199
matrix:
2010
fast_finish: true
2111
include:
22-
- name: "python-3.6"
23-
env: PY=3.6
24-
- name: "python-3.7"
25-
env: PY=3.7
26-
- name: "python-3.8"
27-
env: PY=3.8
2812
- name: coding_standards
29-
env: PY=3.8
13+
env: PY=3
3014
- name: docs
31-
env: PY=3.8
32-
- name: "tarball"
33-
env: PY=3.8
15+
env: PY=3
3416

3517
before_install:
3618
# Install miniconda and create TEST env.
@@ -46,29 +28,11 @@ before_install:
4628
conda create --name TEST python=$PY --file requirements.txt --file requirements-dev.txt
4729
source activate TEST
4830
conda info --all
49-
# Install firefox headless driver.
50-
- |
51-
wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz -O geckodriver.tar.gz
52-
mkdir geckodriver
53-
tar -xzf geckodriver.tar.gz -C geckodriver
54-
export PATH=$PATH:$PWD/geckodriver
5531
5632
install:
5733
- pip install -e . --no-deps --force-reinstall
5834

5935
script:
60-
- if [[ $TRAVIS_JOB_NAME == python-* ]]; then
61-
cp -r tests/ examples/ /tmp ;
62-
pushd /tmp && pytest -n 2 -rxs --cov=branca -vv tests && popd ;
63-
fi
64-
65-
- if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then
66-
python setup.py --version ;
67-
pip wheel . -w dist --no-deps ;
68-
check-manifest --verbose ;
69-
twine check dist/* ;
70-
fi
71-
7236
- if [[ $TRAVIS_JOB_NAME == 'coding_standards' ]]; then
7337
pytest --flake8 -m flake8 ;
7438
fi
@@ -85,17 +49,3 @@ script:
8549
doctr:
8650
require-master: true
8751
sync: False
88-
89-
deploy:
90-
skip_cleanup: true
91-
provider: pypi
92-
user: "__token__"
93-
password:
94-
secure: "ncVXDcUpadOXESusbUv/F5mhXqzjp0fFM+llYdBOWBGpipP2B1cU/cWRUU5fkhL1KZG/0DfVboJsRnNQCebZklJ0fczW2Z2QUzL8zCAK8KLOUqr0Nk8i8Oi5eC0h8Ew+HkDNORsZUCPCjKvqcFHRuSZnVYvEqqPPguSj1fwDdyBm9kW7lfZdPeR9mr79WJs+Miv5UKXGZcQAuzCU7g3AmaizRoUfhXnSgPXd9Yp2DY5nsBUZhmqFTj1xjQwLvqp5w/BiFZGkdqMuWVP9b/HbVJEeRxWgCaDPw+XLkQa+HdfUsDGBvPWaaQ+o6OwuADdCjIHLnVmfA2/E2FSU64IBaIZ1xOkHZpm74P8Y0NF5aRogyipkqhrm0WErRWFD4OYj8ud4y9AHLCAmyyLsKCka76NSxotbTd4W4Xu9MX7fkhGOVzhYXg1GNS6SDTIMn+bujFNg5fZrZUptn6FcNa8THkh7yKrduBv2kgbBcgx0/EodH4q2Ds7yfbFvPkQD+l0mBiOPXOXflcQDOiu0CZ70X2XmLe3v3zIEf51oigEtb/KRkf7B3r/Ab+ayNdS33xbHsE8JYE/6KKjGf+fEr0f4XiidadtCbUmNGCw8fgHo7dY4g7blYMPvab7z4zcHmqekzrSTTwxw2uRtmGLWWJupmOerasRIuLsKiJxnk9oiS+k="
95-
distributions: sdist bdist_wheel
96-
upload_docs: no
97-
on:
98-
repo: python-visualization/branca
99-
tags: true
100-
all_branches: master
101-
condition: '$TRAVIS_JOB_NAME == "tarball"'

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ flake8-print
88
isort
99
jupyter
1010
nbsphinx
11+
nbval
1112
pylint
1213
pytest
1314
pytest-cov

tests/test_notebooks.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)