diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml new file mode 100644 index 00000000000..16ef1d6eb59 --- /dev/null +++ b/.github/workflows/ci_tests_dev.yaml @@ -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 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" diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 37b90a511ce..9b560e68013 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -42,16 +42,33 @@ The main advantages of this are: We use Github Actions and TravisCI continuous integration (CI) services to build and test the project on Linux, macOS and Windows. -The configuration file for these services are in -`.github/workflows/ci_tests.yaml` and `.travis.yml`. They rely on the `requirements.txt` file to install required dependencies using conda and the `Makefile` to run the tests and checks. -There is also a `.github/workflows/cache_data.yaml` file which caches some GMT -remote data files needed for the Github Actions CI on a regular basis. + +### Github Actions + +There are 3 configuration files located in `.github/workflows`: + +1. `ci_tests.yaml` (Style Checks, Tests on Linux/macOS/Windows) + +This is ran on every commit on the *master* and Pull Request branches. +It is also scheduled to run daily on the *master* branch. + +2. `ci_tests_dev.yaml` (GMT Master Tests on Linux/macOS). + +This is only triggered when a review is requested or re-requested on a PR. +It is also scheduled to run daily on the *master* branch. + +3. `cache_data.yaml` (Caches GMT remote data files needed for Github Actions CI) + +This is scheduled to run every Sunday at 12 noon. If new remote files are needed urgently, maintainers can manually uncomment the 'pull_request:' line in that `cache_data.yaml` file to refresh the cache. -Travis also handles all of our deployments automatically: +### Travis CI + +The configuration file is at `.travis.yml`. +Travis runs tests (Linux only) and handles all of our deployments automatically: * Updating the development documentation by pushing the built HTML pages from the *master* branch onto the `dev` folder of the *gh-pages* branch. diff --git a/README.rst b/README.rst index 7d399e37489..8b56cfe997e 100644 --- a/README.rst +++ b/README.rst @@ -13,8 +13,11 @@ PyGMT :alt: Travis CI build status :target: https://travis-ci.org/GenericMappingTools/pygmt .. image:: https://github.com/GenericMappingTools/pygmt/workflows/Tests/badge.svg - :alt: GitHub Actions build status - :target: https://github.com/GenericMappingTools/pygmt/actions + :alt: GitHub Actions Tests status + :target: https://github.com/GenericMappingTools/pygmt/actions?query=workflow%3ATests +.. image:: https://github.com/GenericMappingTools/pygmt/workflows/GMT%20Master%20Tests/badge.svg + :alt: GitHub Actions GMT Master Tests status + :target: https://github.com/GenericMappingTools/pygmt/actions?query=workflow%3A"GMT+Master+Tests" .. image:: https://img.shields.io/codecov/c/github/GenericMappingTools/pygmt/master.svg?style=flat-square :alt: Test coverage status :target: https://codecov.io/gh/GenericMappingTools/pygmt