|
| 1 | +# This workflow installs PyGMT dependencies, builds documentation and runs tests on GMT master |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: GMT Master Tests |
| 5 | + |
| 6 | +on: |
| 7 | + # push: |
| 8 | + # branches: [ master ] |
| 9 | + pull_request: |
| 10 | + types: [review_requested, ready_for_review] |
| 11 | + # Schedule daily tests |
| 12 | + schedule: |
| 13 | + - cron: '0 0 * * *' |
| 14 | + |
| 15 | +jobs: |
| 16 | + test_gmt_master: |
| 17 | + name: ${{ matrix.os }} - Python ${{ matrix.python-version }} |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + python-version: [3.8] |
| 23 | + os: [ubuntu-20.04, macOS-10.15] |
| 24 | + env: |
| 25 | + # LD_LIBRARY_PATH: ${{ github.workspace }}/gmt/lib:$LD_LIBRARY_PATH |
| 26 | + GMT_INSTALL_DIR: ${{ github.workspace }}/gmt-install-dir |
| 27 | + GMT_LIBRARY_PATH: ${{ github.workspace }}/gmt-install-dir/lib |
| 28 | + defaults: |
| 29 | + run: |
| 30 | + shell: bash -l {0} |
| 31 | + |
| 32 | + steps: |
| 33 | + # Checkout current git repository |
| 34 | + - name: Checkout |
| 35 | + |
| 36 | + with: |
| 37 | + # fecth all history so that versioneer works |
| 38 | + fetch-depth: 0 |
| 39 | + |
| 40 | + # Setup Miniconda |
| 41 | + - name: Setup Miniconda |
| 42 | + |
| 43 | + with: |
| 44 | + python-version: ${{ matrix.python-version }} |
| 45 | + channels: conda-forge |
| 46 | + |
| 47 | + # Install build dependencies from conda-forge |
| 48 | + - name: Install build dependencies |
| 49 | + run: conda install cmake libblas libcblas liblapack fftw gdal ghostscript libnetcdf hdf5 zlib curl pcre ipython pytest pytest-cov pytest-mpl |
| 50 | + |
| 51 | + # Install GMT master branch |
| 52 | + - name: Install GMT from master |
| 53 | + run: curl https://raw.githubusercontent.com/GenericMappingTools/gmt/master/ci/build-gmt-master.sh | bash |
| 54 | + |
| 55 | + # Download cached remote files (artifacts) from Github |
| 56 | + - name: Download remote data from Github |
| 57 | + |
| 58 | + with: |
| 59 | + workflow: cache_data.yaml |
| 60 | + name: gmt-cache |
| 61 | + path: .gmt |
| 62 | + |
| 63 | + # Move downloaded files to ~/.gmt directory and list them |
| 64 | + - name: Move and list downloaded remote files |
| 65 | + shell: bash -l {0} |
| 66 | + run: | |
| 67 | + mkdir -p ~/.gmt |
| 68 | + mv .gmt/* ~/.gmt |
| 69 | + ls -lh ~/.gmt |
| 70 | +
|
| 71 | + # Install the package that we want to test |
| 72 | + - name: Install the package |
| 73 | + run: | |
| 74 | + python setup.py sdist --formats=zip |
| 75 | + pip install dist/* |
| 76 | +
|
| 77 | + # Run the tests |
| 78 | + - name: Test with pytest |
| 79 | + run: make test PYTEST_EXTRA="-r P" |
0 commit comments