6
6
# installed by fetching the latest source codes from the GMT master branch and
7
7
# compiling.
8
8
#
9
- # It is triggered when a pull request is marked as "ready as review", or labeled with
10
- # 'run/test-gmt-dev'. It is also scheduled to run on Monday, Wednesday, and Friday on
11
- # the main branch.
9
+ # It is triggered in a pull request if labeled with 'run/test-gmt-dev'.
10
+ # It is also scheduled to run on Monday, Wednesday, and Friday on the main branch.
12
11
#
13
12
name : GMT Dev Tests
14
13
@@ -87,18 +86,42 @@ jobs:
87
86
pcre
88
87
zlib
89
88
90
- # Build and install latest GMT from GitHub
91
- - name : Install GMT ${{ matrix.gmt_git_ref }} branch (Linux/macOS)
92
- run : curl https://raw.githubusercontent.com/GenericMappingTools/gmt/master/ci/build-gmt.sh | bash
89
+ # Checkout current GMT repository
90
+ - name : Checkout the GMT source from ${{ matrix.gmt_git_ref }} branch
91
+
92
+ with :
93
+ repository : ' GenericMappingTools/gmt'
94
+ ref : ${{ matrix.gmt_git_ref }}
95
+ path : ' gmt'
96
+
97
+ # Build GMT from source on Linux/macOS, script is adapted from
98
+ # https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh
99
+ - name : Build GMT on Linux/macOS
100
+ run : |
101
+ if [ "$RUNNER_OS" == "macOS" ]; then
102
+ GMT_ENABLE_OPENMP=FALSE
103
+ else
104
+ GMT_ENABLE_OPENMP=TRUE
105
+ fi
106
+ cd gmt/
107
+ mkdir build
108
+ cd build
109
+ cmake -G Ninja .. \
110
+ -DCMAKE_INSTALL_PREFIX=${{ env.GMT_INSTALL_DIR }} \
111
+ -DCMAKE_BUILD_TYPE=Release \
112
+ -DGMT_ENABLE_OPENMP=${GMT_ENABLE_OPENMP} \
113
+ -DGMT_USE_THREADS=TRUE
114
+ cmake --build .
115
+ cmake --build . --target install
116
+ cd ..
117
+ rm -rf gmt/
93
118
env :
94
- GMT_GIT_REF : ${{ matrix.gmt_git_ref }}
95
119
GMT_INSTALL_DIR : ${{ runner.temp }}/gmt-install-dir
96
120
if : runner.os != 'Windows'
97
121
98
- - name : Install GMT ${{ matrix.gmt_git_ref }} branch ( Windows)
122
+ - name : Build GMT on Windows
99
123
shell : cmd
100
124
run : |
101
- git clone --depth=1 --single-branch --branch ${{ env.GMT_GIT_REF }} https://github.com/GenericMappingTools/gmt
102
125
cd gmt/
103
126
mkdir build
104
127
cd build
@@ -114,7 +137,6 @@ jobs:
114
137
cd ..
115
138
rm -rf gmt/
116
139
env :
117
- GMT_GIT_REF : ${{ matrix.gmt_git_ref }}
118
140
GMT_INSTALL_DIR : ${{ runner.temp }}/gmt-install-dir
119
141
if : runner.os == 'Windows'
120
142
0 commit comments