Skip to content

Commit 7976fd7

Browse files
authored
Fix failures with bash on Windows (#4985)
1 parent 02fa126 commit 7976fd7

File tree

5 files changed

+60
-43
lines changed

5 files changed

+60
-43
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -128,24 +128,9 @@ jobs:
128128
echo "${INSTALLDIR}/bin" >> $GITHUB_PATH
129129
130130
- name: Check a few simple commands
131-
run: |
132-
set -x -e
133-
gmt --version
134-
gmt-config --all
135-
gmt defaults -Vd
136-
gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -P -Vd > test.ps
137-
gmt begin && gmt coast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -Vd && gmt end
138-
gmt grdimage @earth_relief_01d -JH10c -Baf -pdf map
139-
gmt earthtide -T2018-06-18T12:00:00 -Gsolid_tide_up.grd
131+
run: bash ci/simple-gmt-tests.sh
140132

141133
- name: Check a few simple commands (Windows)
142134
shell: cmd
143-
run: |
144-
gmt --version
145-
bash %INSTALLDIR%/bin/gmt-config --all
146-
gmt defaults -Vd
147-
gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -P -Vd > test.ps
148-
gmt begin && gmt coast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -Vd && gmt end
149-
gmt grdimage @earth_relief_01d -JH10c -Baf -pdf map
150-
gmt earthtide -T2018-06-18T12:00:00 -Gsolid_tide_up.grd
135+
run: call ci/simple-gmt-tests.bat
151136
if: runner.os == 'Windows'

.github/workflows/docker.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,4 @@ jobs:
105105
echo "${INSTALLDIR}/bin" >> $GITHUB_PATH
106106
107107
- name: Check a few simple commands
108-
run: |
109-
set -x -e
110-
gmt --version
111-
gmt-config --all
112-
gmt defaults -Vd
113-
gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -P -Vd > test.ps
114-
gmt begin && gmt coast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -Vd && gmt end
115-
gmt grdimage @earth_relief_01d -JH10c -Baf -pdf map
116-
gmt earthtide -T2018-06-18T12:00:00 -Gsolid_tide_up.grd
108+
run: bash ci/simple-gmt-tests.sh

.github/workflows/tests.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -133,26 +133,11 @@ jobs:
133133
echo "${INSTALLDIR}/bin" >> $GITHUB_PATH
134134
135135
- name: Check a few simple commands
136-
run: |
137-
set -x -e
138-
gmt --version
139-
gmt-config --all
140-
gmt defaults -Vd
141-
gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -P -Vd > test.ps
142-
gmt begin && gmt coast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -Vd && gmt end
143-
gmt grdimage @earth_relief_01d -JH10c -Baf -pdf map
144-
gmt earthtide -T2018-06-18T12:00:00 -Gsolid_tide_up.grd
136+
run: bash ci/simple-gmt-tests.sh
145137

146138
- name: Check a few simple commands (Windows)
147139
shell: cmd
148-
run: |
149-
gmt --version
150-
bash %INSTALLDIR%/bin/gmt-config --all
151-
gmt defaults -Vd
152-
gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -P -Vd > test.ps
153-
gmt begin && gmt coast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -Vd && gmt end
154-
gmt grdimage @earth_relief_01d -JH10c -Baf -pdf map
155-
gmt earthtide -T2018-06-18T12:00:00 -Gsolid_tide_up.grd
140+
run: call ci/simple-gmt-tests.bat
156141
if: runner.os == 'Windows'
157142

158143
# Run full tests and rerun failed tests

ci/simple-gmt-tests.bat

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
REM
2+
REM Run some simple GMT commands
3+
REM
4+
5+
REM Check GMT version
6+
gmt --version
7+
8+
REM Check GMT configuration
9+
bash %INSTALLDIR%/bin/gmt-config --all
10+
11+
REM Check GMT defaults
12+
gmt defaults -Vd
13+
14+
REM Check GMT classic mode, GSHHG and DCW
15+
gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -P -Vd > test.ps
16+
17+
REM Check GMT modern mode, GSHHG and DCW
18+
gmt begin && gmt coast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -Vd && gmt end
19+
20+
REM Check remote file and modern one-liner
21+
gmt grdimage @earth_relief_01d -JH10c -Baf -pdf map
22+
23+
REM Check supplemental modules
24+
gmt earthtide -T2018-06-18T12:00:00 -Gsolid_tide_up.grd

ci/simple-gmt-tests.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Run some simple GMT commands
4+
#
5+
6+
set -x -e
7+
8+
# Check GMT version
9+
gmt --version
10+
11+
# Check GMT configuration
12+
gmt-config --all
13+
14+
# Check GMT defaults
15+
gmt defaults -Vd
16+
17+
# Check GMT classic mode, GSHHG and DCW
18+
gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -P -Vd > test.ps
19+
20+
# Check GMT modern mode, GSHHG and DCW
21+
if [ "${RUNNER_OS}" == "Windows" ]; then export GMT_SESSION_NAME=$$; fi
22+
gmt begin && gmt coast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -Vd && gmt end
23+
if [ "${RUNNER_OS}" == "Windows" ]; then unset GMT_SESSION_NAME; fi
24+
25+
# Check remote file and modern one-liner
26+
gmt grdimage @earth_relief_01d -JH10c -Baf -pdf map
27+
28+
# Check supplemental modules
29+
gmt earthtide -T2018-06-18T12:00:00 -Gsolid_tide_up.grd
30+
31+
set +x +e

0 commit comments

Comments
 (0)