Skip to content

GMT Legacy Tests

GMT Legacy Tests #17

# Test PyGMT with GMT legacy versions on Linux/macOS/Windows
#
# This workflow runs regular PyGMT tests with GMT legacy versions. Due to the
# minor baseline image changes between GMT versions, the workflow only runs
# the tests but doesn't do image comparisons.
#
# It is scheduled to run every Tuesday on the main branch.
#
name: GMT Legacy Tests
on:
# push:
# branches: [ main ]
# pull_request:
# types: [ready_for_review]
# paths-ignore:
# - 'doc/**'
# - 'examples/**'
# - '*.md'
# - 'README.rst'
# - 'LICENSE.txt'
# - '.gitignore'
# Schedule tests on Tuesday
schedule:
- cron: '0 0 * * 2'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
gmt_version: ['6.3']
timeout-minutes: 30
defaults:
run:
shell: bash -l {0}
steps:
# Checkout current git repository
- name: Checkout
uses: actions/[email protected]
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
# Install Micromamba with conda-forge dependencies
- name: Setup Micromamba
uses: mamba-org/[email protected]
with:
environment-name: pygmt
condarc: |
channels:
- conda-forge
- nodefaults
cache-downloads: true
cache-environment: true
create-args: >-
python=3.9
gmt=${{ matrix.gmt_version }}
numpy
pandas<2
xarray
netCDF4
packaging
contextily
geopandas
ipython
rioxarray
sphinx-gallery
build
dvc
make
pip
pytest
pytest-doctestplus
pytest-mpl
# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
uses: dawidd6/[email protected]
with:
workflow: cache_data.yaml
workflow_conclusion: success
name: gmt-cache
path: .gmt
# Move downloaded files to ~/.gmt directory and list them
- name: Move and list downloaded remote files
run: |
mkdir -p ~/.gmt
mv .gmt/* ~/.gmt
# Change modification times of the two files, so GMT won't refresh it
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
ls -lhR ~/.gmt
# Pull baseline image data from dvc remote (DAGsHub)
- name: Pull baseline image data from dvc remote
run: |
dvc pull pygmt/tests/baseline/test_logo.png --verbose
ls -lhR pygmt/tests/baseline/
# Install the package that we want to test
- name: Install the package
run: make install
# Run the tests but skip images
- name: Run tests
run: make test_no_images PYTEST_EXTRA="-r P"