diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 252f96f7135..83e06e17595 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -122,68 +122,3 @@ jobs: file: ./coverage.xml # optional env_vars: OS,PYTHON fail_ci_if_error: true - - test_gmt_master: - name: GMT master - ${{ matrix.os }} - Python ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - python-version: [3.7] - 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" diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml new file mode 100644 index 00000000000..b4f5fea5ccb --- /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 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" 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