-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (52 loc) · 1.95 KB
/
test-publish.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
name: Test Geodataset and publish
on:
push:
release:
types: [released]
jobs:
test:
runs-on: ubuntu-latest
env:
TEST_DATA_DIR: /netcdf
container:
image: nansencenter/geodataset:latest
env:
TEST_DATA_DIR: ${{ env.TEST_DATA_DIR }}
steps:
- name: Cache
uses: actions/cache@v2
with:
path: ${{ env.TEST_DATA_DIR }}
key: 0
id: cache
- name: Download test data
run : |
mkdir -p $TEST_DATA_DIR
gdown https://drive.google.com/uc?id=1NmJeldiS5XlIwciDhej8Mas8g1Ng9T6n -O $TEST_DATA_DIR/
gdown https://drive.google.com/uc?id=1j1zkyNDM9EwcvgipMskhuRDoe6mYBhnN -O $TEST_DATA_DIR/
gdown https://drive.google.com/uc?id=1GvwVxIPi4S_0uJDiSeXURYKu8fCQlLxx -O $TEST_DATA_DIR/
gdown https://drive.google.com/uc?id=1S0OLfr6DdJIflZC6mVbYTjKHj4XZ4TKg -O $TEST_DATA_DIR/
gdown https://drive.google.com/uc?id=1RD9V1iS-tS0QIdg2IUyX_KR4PK3SpbFl -O $TEST_DATA_DIR/
gdown https://drive.google.com/uc?id=1KGapeF6EG4h8gGPxNbkyRnRBYu3i7bdD -O $TEST_DATA_DIR/
gdown https://drive.google.com/uc?id=1dRo0gfoJCinnOhA96YQpqnddhbdW_Z09 -O $TEST_DATA_DIR/
gdown https://drive.google.com/uc?id=1JReSKt2nBKAf9mRwrbnoLQPewFqK2l93 -O $TEST_DATA_DIR/
gdown https://drive.google.com/uc?id=1c1nyBFjNuM8njurt5FcK49Bz14R_O2Jx -O $TEST_DATA_DIR/
if: steps.cache.outputs.cache-hit != 'true'
- uses: actions/checkout@v2
- name: Test with pytest
run: |
pytest
publish:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v2
- name: Build Python package
run: >
GEODATASET_RELEASE="${GITHUB_REF#refs/tags/}"
python setup.py sdist bdist_wheel
- name: Publish Python package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}