forked from GenericMappingTools/gmt
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (118 loc) · 4.24 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#
# Build GMT source codes on different Linux distros using dockers.
#
name: Docker
on:
push:
branches:
- master
- 6.[0-9]+
paths:
- 'ci/**'
- 'cmake/**'
- 'src/**'
- '**/CMakeLists.txt'
- '.github/workflows/docker.yml'
pull_request:
paths:
- 'ci/**'
- 'cmake/**'
- 'src/**'
- '**/CMakeLists.txt'
- '.github/workflows/docker.yml'
defaults:
run:
# default to use bash shell
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
docker:
name: ${{ matrix.image }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
env:
# directories
COASTLINEDIR: ${{ github.workspace }}/coastline
INSTALLDIR: ${{ github.workspace }}/gmt-install-dir
# disable auto-display of GMT plots
GMT_END_SHOW: off
# Compile only
BUILD_DOCS : false
PACKAGE : false
RUN_TESTS : false
strategy:
fail-fast: false
matrix:
image:
# Ubuntu: https://en.wikipedia.org/wiki/Ubuntu_version_history#Table_of_versions
- ubuntu:20.04 # CMake 3.16.3 + GNU 9.3.0; EOL: 2025-05-29
- ubuntu:22.04 # CMake 3.22.1 + GNU 11.2.0; EOL: 2027-06-01
- ubuntu:24.04 # CMake 3.28.3 + GNU 13.2.0; EOL: 2029-05-31
# Debian: https://en.wikipedia.org/wiki/Debian_version_history#Release_table
- debian:11 # CMake 3.18.4 + GNU 10.2.1; EOL: 2026-06-01
- debian:12 # CMake 3.25.1 + GNU 12.2.0; EOL: 2028-06-01
- debian:sid # rolling release with latest versions
# Fedora: https://en.wikipedia.org/wiki/Fedora_Linux_release_history
- fedora:39 # CMake 3.27.7 + GNU 13.2.1; EOL: 2024-11-12
- fedora:40 # CMake 3.28.2 + GNU 14.0.1; EOL: 2025-05-13
- fedora:rawhide # rolling release with latest versions
steps:
- name: Checkout
uses: actions/[email protected]
- name: Install GMT dependencies
run: |
os=$(cat /etc/os-release | grep "^ID=" | awk -F= '{print $2}')
if [[ "$os" = "ubuntu" || "$os" = "debian" ]]; then
apt-get update
DEBIAN_FRONTEND="noninteractive" TZ="America/New_York" apt-get install -y tzdata
apt-get install -y --no-install-recommends --no-install-suggests \
build-essential cmake ninja-build \
libcurl4-gnutls-dev libnetcdf-dev libgdal-dev \
libfftw3-dev libpcre3-dev liblapack-dev libglib2.0-dev \
ghostscript curl git
apt reinstall -y ca-certificates
update-ca-certificates
elif [[ "$os" = "fedora" ]]; then
dnf install -y \
cmake ninja-build \
libcurl-devel netcdf-devel gdal-devel gdal \
fftw3-devel pcre-devel lapack-devel openblas-devel glib2-devel \
ghostscript openssl
fi
- name: Cache GSHHG and DCW data
uses: actions/cache@v4
id: cache-coastline
with:
path: ${{ env.COASTLINEDIR }}
key: coastline-${{ hashFiles('ci/download-coastlines.sh') }}
- name: Download coastlines
run: bash ci/download-coastlines.sh
if: steps.cache-coastline.outputs.cache-hit != 'true'
- name: Configure GMT
run: bash ci/config-gmt-unix.sh
- name: Compile and install GMT
run: |
mkdir build
cd build
cmake -G Ninja ..
cmake --build .
cmake --build . --target install
# Add GMT PATH to bin
echo "${INSTALLDIR}/bin" >> $GITHUB_PATH
- name: Download cached GMT remote data from GitHub Artifacts
uses: dawidd6/[email protected]
with:
workflow: ci-caches.yml
name: gmt-cache
path: gmt-cache
# Move downloaded files to ~/.gmt directory and list them
- name: Move and list downloaded remote files
run: |
mkdir -p ~/.gmt/static/
mv gmt-cache/* ~/.gmt/static/
ls -lRh ~/.gmt/static/
- name: Check a few simple commands
run: bash ci/simple-gmt-tests.sh