-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move GMT Master Tests to separate yaml file and add a badge for it
Also run the tests only on PRs that are ready for review or have a review requested (i.e. non-draft PRs). Based on https://github.saobby.my.eu.orgmunity/t/dont-run-actions-on-draft-pull-requests/16817/6.
- Loading branch information
Showing
3 changed files
with
84 additions
and
67 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# This workflow installs PyGMT dependencies, builds documentation and runs tests on GMT master | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: GMT Master Tests | ||
|
||
on: | ||
# push: | ||
# branches: [ master ] | ||
pull_request: | ||
types: [review_requested, ready_for_review] | ||
# Schedule daily tests | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
test_gmt_master: | ||
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8] | ||
os: [ubuntu-20.04, macOS-10.15] | ||
env: | ||
# LD_LIBRARY_PATH: ${{ github.workspace }}/gmt/lib:$LD_LIBRARY_PATH | ||
GMT_INSTALL_DIR: ${{ github.workspace }}/gmt-install-dir | ||
GMT_LIBRARY_PATH: ${{ github.workspace }}/gmt-install-dir/lib | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
# Checkout current git repository | ||
- name: Checkout | ||
uses: actions/checkout@v2.3.1 | ||
with: | ||
# fecth all history so that versioneer works | ||
fetch-depth: 0 | ||
|
||
# Setup Miniconda | ||
- name: Setup Miniconda | ||
uses: goanpeca/setup-miniconda@v1.6.0 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
channels: conda-forge | ||
|
||
# Install build dependencies from conda-forge | ||
- name: Install build dependencies | ||
run: conda install cmake libblas libcblas liblapack fftw gdal ghostscript libnetcdf hdf5 zlib curl pcre gshhg-gmt dcw-gmt ipython pytest pytest-cov pytest-mpl | ||
|
||
# Install GMT master branch | ||
- name: Install GMT from master | ||
run: curl https://raw.githubusercontent.com/GenericMappingTools/gmt/master/ci/build-gmt-master.sh | bash | ||
|
||
# Download cached remote files (artifacts) from Github | ||
- name: Download remote data from Github | ||
uses: dawidd6/action-download-artifact@v2.6.3 | ||
with: | ||
workflow: cache_data.yaml | ||
name: gmt-cache | ||
path: .gmt | ||
|
||
# Move downloaded files to ~/.gmt directory and list them | ||
- name: Move and list downloaded remote files | ||
shell: bash -l {0} | ||
run: | | ||
mkdir -p ~/.gmt | ||
mv .gmt/* ~/.gmt | ||
ls -lh ~/.gmt | ||
# Install the package that we want to test | ||
- name: Install the package | ||
run: | | ||
python setup.py sdist --formats=zip | ||
pip install dist/* | ||
# Run the tests | ||
- name: Test with pytest | ||
run: make test PYTEST_EXTRA="-r P" |
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