From d828fefa56b555a63e2dfb4e8f50819cbc9d614e Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 14 Jan 2026 10:38:13 +0800 Subject: [PATCH 1/9] CI: Combine the steps for building GMT source code in the 'GMT Dev Tests' workflow --- .github/workflows/ci_tests_dev.yaml | 34 +++++++++-------------------- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index bb319ba0adc..e5dcf953cea 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -103,44 +103,30 @@ jobs: # Build GMT from source on Linux/macOS, script is adapted from # https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh - - name: Build GMT on Linux/macOS - run: | - cd gmt/ - mkdir build - cd build - cmake -G Ninja .. \ - -DCMAKE_INSTALL_PREFIX=${GMT_INSTALL_DIR} \ - -DCMAKE_BUILD_TYPE=Release \ - -DGMT_ENABLE_OPENMP=TRUE \ - -DGMT_USE_THREADS=TRUE - cmake --build . - cmake --build . --target install - cd .. - rm -rf gmt/ - env: - GMT_INSTALL_DIR: ${{ runner.temp }}/gmt-install-dir - if: runner.os != 'Windows' - - - name: Build GMT on Windows + - name: Build GMT from source shell: bash run: | cd gmt/ mkdir build cd build - cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + if [[ "$RUNNER_OS" == "Windows" ]]; then + cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + CMAKE_PREFIX_PATH="-DCMAKE_PREFIX_PATH=$MAMBA_ROOT_PREFIX/envs/pygmt/Library" + else + CMAKE_PREFIX_PATH="" + fi cmake -G Ninja .. \ + $CMAKE_PREFIX_PATH \ -DCMAKE_INSTALL_PREFIX="$GMT_INSTALL_DIR" \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH="$MAMBA_ROOT_PREFIX/envs/pygmt/Library" \ -DGMT_ENABLE_OPENMP=TRUE \ -DGMT_USE_THREADS=TRUE cmake --build . cmake --build . --target install - cd .. - rm -rf gmt/ + cd ../../ + rm -rf gmt env: GMT_INSTALL_DIR: ${{ runner.temp }}/gmt-install-dir - if: runner.os == 'Windows' - name: Add GMT's bin to PATH run: echo '${{ runner.temp }}/gmt-install-dir/bin' >> $GITHUB_PATH From e01666d360b86c63c3a323370a8644a330edf2c4 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 14 Jan 2026 10:43:20 +0800 Subject: [PATCH 2/9] Use bash -l -zsh --- .github/workflows/ci_tests_dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index e5dcf953cea..b409a55daf0 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -104,7 +104,7 @@ jobs: # Build GMT from source on Linux/macOS, script is adapted from # https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh - name: Build GMT from source - shell: bash + shell: bash -l {0} run: | cd gmt/ mkdir build From b4d87dcd70a44bfa15900a72a5bf7e678eefad68 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 14 Jan 2026 11:01:07 +0800 Subject: [PATCH 3/9] Remove the 'shell' setting Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- .github/workflows/ci_tests_dev.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index b409a55daf0..413b8f486b5 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -104,7 +104,6 @@ jobs: # Build GMT from source on Linux/macOS, script is adapted from # https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh - name: Build GMT from source - shell: bash -l {0} run: | cd gmt/ mkdir build From 87c754254b7c79f891d66dd14be8eb0bf155a8b6 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 14 Jan 2026 11:09:23 +0800 Subject: [PATCH 4/9] Remove the build directory rather than the gmt source code directory --- .github/workflows/ci_tests_dev.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 413b8f486b5..28227651b8c 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -122,8 +122,8 @@ jobs: -DGMT_USE_THREADS=TRUE cmake --build . cmake --build . --target install - cd ../../ - rm -rf gmt + cd .. + rm -rf build env: GMT_INSTALL_DIR: ${{ runner.temp }}/gmt-install-dir From 92c2432b00bc7e780a4da9068bc798b48ef3775f Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 14 Jan 2026 11:23:45 +0800 Subject: [PATCH 5/9] Use no-login shell --- .github/workflows/ci_tests_dev.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 28227651b8c..00a6f3f0381 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -104,6 +104,7 @@ jobs: # Build GMT from source on Linux/macOS, script is adapted from # https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh - name: Build GMT from source + shell: bash run: | cd gmt/ mkdir build From 00cee76f9e80413b23f87adb7b84b7ab067a9793 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 14 Jan 2026 11:43:55 +0800 Subject: [PATCH 6/9] Set CMAKE_LIBRARY_PATH on all platforms --- .github/workflows/ci_tests_dev.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 00a6f3f0381..25261ea2d6a 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -111,12 +111,12 @@ jobs: cd build if [[ "$RUNNER_OS" == "Windows" ]]; then cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - CMAKE_PREFIX_PATH="-DCMAKE_PREFIX_PATH=$MAMBA_ROOT_PREFIX/envs/pygmt/Library" + CMAKE_PREFIX_PATH=$MAMBA_ROOT_PREFIX/envs/pygmt/Library" else - CMAKE_PREFIX_PATH="" + CMAKE_PREFIX_PATH=$MAMBA_ROOT_PREFIX/envs/pygmt/lib" fi cmake -G Ninja .. \ - $CMAKE_PREFIX_PATH \ + -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \ -DCMAKE_INSTALL_PREFIX="$GMT_INSTALL_DIR" \ -DCMAKE_BUILD_TYPE=Release \ -DGMT_ENABLE_OPENMP=TRUE \ From 83ed842b92636ddef63194e890d6e9d2c5098866 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 14 Jan 2026 12:06:29 +0800 Subject: [PATCH 7/9] Fix CMAKE_PREFIX_PATH for Linux/macOS --- .github/workflows/ci_tests_dev.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 25261ea2d6a..0e9db9470af 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -111,12 +111,12 @@ jobs: cd build if [[ "$RUNNER_OS" == "Windows" ]]; then cmd.exe /c "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - CMAKE_PREFIX_PATH=$MAMBA_ROOT_PREFIX/envs/pygmt/Library" + CMAKE_PREFIX_PATH="$MAMBA_ROOT_PREFIX/envs/pygmt/Library" else - CMAKE_PREFIX_PATH=$MAMBA_ROOT_PREFIX/envs/pygmt/lib" + CMAKE_PREFIX_PATH="$MAMBA_ROOT_PREFIX/envs/pygmt" fi cmake -G Ninja .. \ - -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \ + -DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \ -DCMAKE_INSTALL_PREFIX="$GMT_INSTALL_DIR" \ -DCMAKE_BUILD_TYPE=Release \ -DGMT_ENABLE_OPENMP=TRUE \ From 874b1853904ac224e74561be02d91ee255adbe7d Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 14 Jan 2026 12:18:38 +0800 Subject: [PATCH 8/9] Use non-login shell on Windows and login shell on Linux/macOS --- .github/workflows/ci_tests_dev.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index 0e9db9470af..c7cff8d010d 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -104,7 +104,8 @@ jobs: # Build GMT from source on Linux/macOS, script is adapted from # https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh - name: Build GMT from source - shell: bash + # Use non-login shell on Windows and login shell on Linux/macOS + shell: ${{ runner.os == 'Windows' && 'bash' || 'bash -l {0}' }} run: | cd gmt/ mkdir build From 290e57b17f303142a9d746f3316f933c9214c526 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 14 Jan 2026 12:49:16 +0800 Subject: [PATCH 9/9] Revert "Use non-login shell on Windows and login shell on Linux/macOS" This reverts commit 874b1853904ac224e74561be02d91ee255adbe7d. --- .github/workflows/ci_tests_dev.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci_tests_dev.yaml b/.github/workflows/ci_tests_dev.yaml index c7cff8d010d..0e9db9470af 100644 --- a/.github/workflows/ci_tests_dev.yaml +++ b/.github/workflows/ci_tests_dev.yaml @@ -104,8 +104,7 @@ jobs: # Build GMT from source on Linux/macOS, script is adapted from # https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh - name: Build GMT from source - # Use non-login shell on Windows and login shell on Linux/macOS - shell: ${{ runner.os == 'Windows' && 'bash' || 'bash -l {0}' }} + shell: bash run: | cd gmt/ mkdir build