33# This workflow runs regular PyGMT tests with the GMT dev version, and also
44# pre-release versions of several dependencies like NumPy, Pandas, Xarray, etc.
55# If any tests fail, it also uploads the diff images as workflow artifacts.
6- # On Linux/macOS, GMT dev version is installed by fetching the latest source
7- # codes from the GMT master branch and compiling.
8- # On Windows, GMT dev version is installed from the conda-forge's dev channel
9- # due to the complexity of building GMT source codes on Windows.
6+ # The GMT dev version is installed by fetching the latest source codes from
7+ # the GMT master branch and compiling.
108#
119# It is triggered when a pull request is marked as "ready as review", or using
1210# the slash command `/test-gmt-dev`. It is also scheduled to run on Monday,
@@ -16,7 +14,7 @@ name: GMT Dev Tests
1614
1715on :
1816 # push:
19- # branches: [ main ]
17+ # branches: [ main ]
2018 pull_request :
2119 types : [ready_for_review]
2220 paths-ignore :
@@ -116,6 +114,34 @@ jobs:
116114 pcre
117115 zlib
118116
117+ # Build and install latest GMT from GitHub
118+ - name : Install GMT ${{ matrix.gmt_git_ref }} branch (Linux/macOS)
119+ run : curl https://raw.githubusercontent.com/GenericMappingTools/gmt/master/ci/build-gmt.sh | bash
120+ env :
121+ GMT_GIT_REF : ${{ matrix.gmt_git_ref }}
122+ GMT_INSTALL_DIR : ${{ github.workspace }}/gmt-install-dir
123+ if : runner.os != 'Windows'
124+
125+ - name : Install GMT ${{ matrix.gmt_git_ref }} branch (Windows)
126+ shell : cmd
127+ run : |
128+ git clone --depth=1 --single-branch --branch ${{ env.GMT_GIT_REF }} https://github.com/GenericMappingTools/gmt
129+ cd gmt/
130+ mkdir build
131+ cd build
132+ call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
133+ cmake -G Ninja .. -DCMAKE_INSTALL_PREFIX=${{ env.GMT_INSTALL_DIR }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{ env.MAMBA_ROOT_PREFIX }}\envs\pygmt\Library
134+ cmake --build .
135+ cmake --build . --target install
136+ env :
137+ GMT_GIT_REF : ${{ matrix.gmt_git_ref }}
138+ GMT_INSTALL_DIR : ${{ github.workspace }}/gmt-install-dir
139+ if : runner.os == 'Windows'
140+
141+ - name : Add GMT's bin to PATH
142+ run : |
143+ echo '${{ github.workspace }}/gmt-install-dir/bin' >> $GITHUB_PATH
144+
119145 # Install dependencies from PyPI
120146 - name : Install dependencies
121147 run : |
@@ -136,18 +162,6 @@ jobs:
136162 dvc pull
137163 ls -lhR pygmt/tests/baseline/
138164
139- # Build and install latest GMT from GitHub
140- - name : Install GMT ${{ matrix.gmt_git_ref }} branch (Linux/macOS)
141- run : curl https://raw.githubusercontent.com/GenericMappingTools/gmt/master/ci/build-gmt.sh | bash
142- env :
143- GMT_GIT_REF : ${{ matrix.gmt_git_ref }}
144- GMT_INSTALL_DIR : ${{ github.workspace }}/gmt-install-dir
145- if : runner.os != 'Windows'
146-
147- - name : Install GMT dev version from conda-forge (Windows)
148- run : micromamba install -c conda-forge/label/dev gmt
149- if : runner.os == 'Windows'
150-
151165 # Download cached remote files (artifacts) from GitHub
152166 - name : Download remote data from GitHub
153167 uses : dawidd6/action-download-artifact@v2.28.0
@@ -170,21 +184,11 @@ jobs:
170184 - name : Install the package
171185 run : make install
172186
173- - name : Add GMT's bin to PATH (Linux/macOS)
174- run : echo ${GITHUB_WORKSPACE}/gmt-install-dir/bin >> $GITHUB_PATH
175- if : runner.os != 'Windows'
176-
177187 # Run the tests
178- - name : Test with pytest (Linux/macOS)
188+ - name : Test with pytest
179189 run : make test PYTEST_EXTRA="-r P"
180190 env :
181191 GMT_LIBRARY_PATH : ${{ github.workspace }}/gmt-install-dir/lib
182- if : runner.os != 'Windows'
183-
184- # Run the tests
185- - name : Test with pytest (Windows)
186- run : make test PYTEST_EXTRA="-r P"
187- if : runner.os == 'Windows'
188192
189193 # Upload diff images on test failure
190194 - name : Upload diff images if any test fails
0 commit comments