-
Notifications
You must be signed in to change notification settings - Fork 229
Add a workflow and Makefile target to test old GMT versions every Tuesday #2079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
8d3cf45
f303f81
8e729eb
21024e2
efd3b3f
a239ac8
aa5f410
c8fb052
fd7e209
be81f36
5292538
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,105 @@ | ||||||
# This workflow installs PyGMT and runs tests with old GMT versions | ||||||
|
||||||
name: GMT Backward Tests | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not so sure if 'backward' is a good word, how about 'legacy' (https://en.wikipedia.org/wiki/Legacy_system)? Maybe we need to ask a native English speaker 🙂
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Legacy sounds good and let's wait for some inputs for native English speakers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in be81f36 |
||||||
|
||||||
on: | ||||||
# push: | ||||||
# branches: [ main ] | ||||||
pull_request: | ||||||
# types: [ready_for_review] | ||||||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
paths-ignore: | ||||||
- 'doc/**' | ||||||
- 'examples/**' | ||||||
- '*.md' | ||||||
- 'README.rst' | ||||||
- 'LICENSE.txt' | ||||||
- '.gitignore' | ||||||
# Schedule tests on Tuesday | ||||||
schedule: | ||||||
- cron: '0 0 * * 2' | ||||||
|
||||||
jobs: | ||||||
test: | ||||||
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_version }} | ||||||
runs-on: ${{ matrix.os }} | ||||||
strategy: | ||||||
fail-fast: false | ||||||
matrix: | ||||||
python-version: ['3.8'] | ||||||
os: [ubuntu-20.04, macOS-11, windows-2019] | ||||||
gmt_version: ['6.3'] | ||||||
timeout-minutes: 30 | ||||||
defaults: | ||||||
run: | ||||||
shell: bash -l {0} | ||||||
|
||||||
steps: | ||||||
# Cancel previous runs that are not completed | ||||||
- name: Cancel Previous Runs | ||||||
uses: styfle/[email protected] | ||||||
with: | ||||||
access_token: ${{ github.token }} | ||||||
|
||||||
# Checkout current git repository | ||||||
- name: Checkout | ||||||
uses: actions/[email protected] | ||||||
with: | ||||||
# fetch 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: | ||||||
activate-environment: pygmt | ||||||
python-version: ${{ matrix.python-version }} | ||||||
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=${{ matrix.gmt_version }} numpy \ | ||||||
pandas xarray netCDF4 packaging geopandas \ | ||||||
build dvc make pytest>=6.0 \ | ||||||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
pytest-cov pytest-doctestplus pytest-mpl sphinx-gallery | ||||||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
# Show installed pkg information for postmortem diagnostic | ||||||
- name: List installed packages | ||||||
run: mamba list | ||||||
|
||||||
# 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to rename the workflow file if we decide to call it "GMT Legacy Tests"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in be81f36.