Repository navigation
138 lines (121 loc) · 4.3 KB
/
Copy pathdocker.yml
File metadata and controls
138 lines (121 loc) · 4.3 KB
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
134
135
136
137
138
#
# Build GMT source codes on different Linux distros using dockers.
#
# This workflow is triggered by push or pull request events.
#
name: Docker
on:
push:
branches:
- master
- 6.[0-9]+
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
permissions:
contents: read
actions: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
changes:
name: Detect relevant changes
runs-on: ubuntu-slim
permissions:
contents: read
pull-requests: read # required by dorny/paths-filter on pull_request events
outputs:
relevant: ${{ steps.filter.outputs.relevant }}
steps:
# paths-filter needs a checkout for push events; on PRs it uses the API
- uses: actions/checkout@v7.0.1
- uses: dorny/paths-filter@v4.0.3
id: filter
with:
filters: |
relevant:
- 'ci/**'
- 'cmake/**'
- 'src/**'
- '**/CMakeLists.txt'
- '.github/workflows/docker.yml'
docker:
name: ${{ matrix.image }}
needs: changes
if: needs.changes.outputs.relevant == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
timeout-minutes: 30
env:
# directories
COASTLINEDIR: ${{ github.workspace }}/coastline
INSTALLDIR: ${{ github.workspace }}/gmt-install-dir
# disable auto-display of GMT plots
GMT_END_SHOW: off
# Compile only. Used by ci/config-gmt.sh
RUN_TESTS: false
strategy:
fail-fast: false
matrix:
image:
# Test the oldest and latest Ubuntu LTS releases and also unstable Debian/Fedora
# Ubuntu: https://en.wikipedia.org/wiki/Ubuntu_version_history#Table_of_versions
- ubuntu:22.04 # CMake 3.22.1 + GNU 11.2.0; EOL: 2027-06-01
- ubuntu:26.04 # CMake 4.2.3 + GNU 15.2.0; EOL: 2031-05-29
- debian:sid # rolling release with latest versions
- fedora:rawhide # rolling release with latest versions
steps:
- name: Install GMT dependencies
run: |
. /etc/os-release
if [[ "$ID" = "ubuntu" || "$ID" = "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 libpcre2-dev liblapack-dev libglib2.0-dev \
ghostscript curl git
apt reinstall -y ca-certificates
update-ca-certificates
# Install gh from binary deb package.
curl -LO https://github.com/cli/cli/releases/download/v2.100.0/gh_2.100.0_linux_amd64.deb
apt install -y ./gh_2.100.0_linux_amd64.deb
elif [[ "$ID" = "fedora" ]]; then
dnf install -y --disablerepo=fedora-cisco-openh264 \
gcc git cmake ninja-build \
libcurl-devel netcdf-devel gdal-devel \
fftw3-devel pcre2-devel lapack-devel openblas-devel glib2-devel \
ghostscript gh
fi
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Fixup git
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Download GSHHG and DCW data
run: gh run download -n coastline-cache -D coastline
env:
GH_TOKEN: ${{ github.token }}
- name: Configure GMT
run: bash ci/config-gmt.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
run: |
gh run download -n gmt-cache -D ~/.gmt/static/
touch ~/.gmt/static/gmt_data_server.txt ~/.gmt/static/gmt_hash_server.txt
env:
GH_TOKEN: ${{ github.token }}
- name: Check a few simple commands
run: bash ci/simple-gmt-tests.sh