GMT CI Caches #178
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Create CI caches for: | |
# | |
# 1. GMT remote data for building documentation and running tests | |
# 2. vcpkg libraries on Windows | |
# | |
name: GMT CI Caches | |
on: | |
# Uncomment the "push:" line to manually re-cache data artifacts in pushes | |
#push: | |
# Uncomment the 'pull_request:' line to manually re-cache data artifacts in PRs | |
#pull_request: | |
# Schedule runs on 12 noon every Sunday | |
schedule: | |
- cron: '0 12 * * 0' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
jobs: | |
data_cache: | |
name: Cache GMT data | |
# We have to use macOS, because Linux/Windows agents may fail to download | |
runs-on: macOS-latest | |
steps: | |
- name: Install GMT | |
run: brew install gmt | |
- name: Download remote data | |
run: | | |
# list of datasets used in tests | |
data="@earth_relief_01d_p earth_relief_01d_g \ | |
@earth_relief_30m \ | |
@earth_relief_20m \ | |
@earth_relief_15m \ | |
@earth_relief_10m_p @earth_relief_10m_g \ | |
@earth_relief_06m \ | |
@earth_relief_05m_p @earth_relief_05m_g \ | |
@earth_relief_04m \ | |
@earth_relief_02m \ | |
@earth_relief_01m \ | |
@earth_day_01d \ | |
@earth_day_20m \ | |
@earth_night_20m \ | |
@earth_age_10m \ | |
@earth_age_06m \ | |
@earth_age_02m \ | |
@earth_mask_05m \ | |
@earth_mask_30s_p" | |
# Download remote data multiple times to make sure all are downloaded | |
gmt which -Ga $data | |
gmt which -Ga $data | |
gmt which -Ga $data | |
# Download cache files | |
gmt get -Dcache | |
# Download extra tiles for tests | |
# test/grdimage/rounding.sh | |
gmt grdcut -R3:57/4:18/44:00/44:15 @earth_relief_03s -G/dev/null | |
# doc/example/anim02 | |
gmt grdcut @earth_relief_30s -R-108/-103/35/40 -G/dev/null | |
# doc/example/ex32 | |
gmt grdcut @earth_relief_30s_p -R3/9/50/54 -G/dev/null | |
# Upload the downloaded files as artifacts to GitHub | |
- name: Upload artifacts to GitHub | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gmt-cache | |
path: | | |
~/.gmt/cache | |
~/.gmt/server | |
vcpkg_cache: | |
name: Cache vcpkg libraries | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.6.0 | |
- name: Install vcpkg libraries | |
run: bash ci/install-dependencies-windows.sh | |
- name: Upload artifacts to GitHub | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vcpkg-cache | |
# VCPKG_INSTALLATION_ROOT is C:\vcpkg | |
path: C:\vcpkg\installed\ |