-
Notifications
You must be signed in to change notification settings - Fork 249
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8d3cf45
Add a workflow to test old GMT versions on Monday/Wednesday/Friday
seisman f303f81
pull baseline image needed by tests
seisman 8e729eb
Run the CI job on Tuesday
seisman 21024e2
Should download test_logo.png instead
seisman efd3b3f
Update workflow description
seisman a239ac8
Merge branch 'main' into test-old-gmt-versions
seisman aa5f410
Merge branch 'main' into test-old-gmt-versions
seisman c8fb052
Merge branch 'main' into test-old-gmt-versions
seisman fd7e209
Test on oldest supported versions of Python and OS
seisman be81f36
Change Backward to Legacy
seisman 5292538
Skip the workflow in PR
seisman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| 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 Legacy Tests | ||
|
|
||
| on: | ||
| # push: | ||
| # branches: [ main ] | ||
| pull_request: | ||
| # types: [ready_for_review] | ||
| paths-ignore: | ||
| - 'doc/**' | ||
| - 'examples/**' | ||
| - '*.md' | ||
| - 'README.rst' | ||
| - 'LICENSE.txt' | ||
| - '.gitignore' | ||
|
seisman marked this conversation as resolved.
Outdated
|
||
| # 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/cancel-workflow-action@0.10.0 | ||
| with: | ||
| access_token: ${{ github.token }} | ||
|
|
||
| # Checkout current git repository | ||
| - name: Checkout | ||
| uses: actions/checkout@v3.0.2 | ||
| with: | ||
| # fetch all history so that setuptools-scm works | ||
| fetch-depth: 0 | ||
|
|
||
| # Install Mambaforge with conda-forge dependencies | ||
| - name: Setup Mambaforge | ||
| uses: conda-incubator/setup-miniconda@v2.1.1 | ||
| 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 \ | ||
| pytest-cov pytest-doctestplus pytest-mpl sphinx-gallery | ||
|
|
||
| # 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/action-download-artifact@v2.22.0 | ||
| 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" | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.