-
Notifications
You must be signed in to change notification settings - Fork 224
62 lines (54 loc) · 1.78 KB
/
cache_data.yaml
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
# This workflow gets and uploads the GMT data artifacts used in the PyGMT CI tests
name: Cache data
on:
# Uncomment the 'pull_request' line below to manually re-cache data artifacts
# pull_request:
# Schedule runs on 12 noon every Sunday
schedule:
- cron: '0 12 * * 0'
jobs:
gmt_cache:
name: Cache GMT artifacts
runs-on: macOS-latest
defaults:
run:
shell: bash -l {0}
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected]
with:
# fecth all history so that setuptools-scm works
fetch-depth: 0
# Install Mambaforge with conda-forge dependencies
- name: Setup Mambaforge
uses: conda-incubator/[email protected]
with:
channels: conda-forge,nodefaults
channel-priority: strict
miniforge-version: latest
miniforge-variant: Mambaforge
mamba-version: "*"
use-mamba: true
# Install GMT and other required dependencies from conda-forge
- name: Install dependencies
run: |
mamba install gmt=6.2.0 \
numpy pandas xarray netCDF4 packaging matplotlib
# Install the package that we want to test
- name: Install the package
run: |
python setup.py sdist --formats=zip
pip install dist/*
# Download remote files
- name: Download remote data
run: |
python -c "from pygmt.helpers.testing import download_test_data; download_test_data()"
# Upload the downloaded files as artifacts to GitHub
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v2
with:
name: gmt-cache
path: |
~/.gmt/cache
~/.gmt/server