Skip to content

CI: Bump to Ghostscript 10.03.0 (#8482) #7893

CI: Bump to Ghostscript 10.03.0 (#8482)

CI: Bump to Ghostscript 10.03.0 (#8482) #7893

Workflow file for this run

#
# Build GMT and run a few simple tests
#
name: Build
on:
push:
branches:
- master
- 6.[0-9]+
paths:
- 'ci/**'
- 'cmake/**'
- 'src/**'
- '**/CMakeLists.txt'
- '.github/workflows/build.yml'
pull_request:
paths:
- 'ci/**'
- 'cmake/**'
- 'src/**'
- 'CMakeLists.txt'
- '.github/workflows/build.yml'
defaults:
run:
# default to use bash shell
shell: bash -el {0}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
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:
include:
- name: Linux
os: ubuntu-latest
- name: macOS
os: macos-latest
- name: Windows
os: windows-latest
- name: Linux (without optional dependencies)
os: ubuntu-latest
EXCLUDE_OPTIONAL : true
steps:
- name: Checkout
uses: actions/checkout@v4.1.4
- name: Setup vcpkg (Windows)
run: gh run download -n vcpkg-cache -D C:/vcpkg/installed/
if: runner.os == 'Windows'
env:
GH_TOKEN: ${{ github.token }}
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
if: runner.os == 'macOS'
- name: Install GMT dependencies
run: |
# $RUNNER_OS can be Linux, macOS or Windows
# The following command converts $RUNNER_OS to lowercase
os=$(echo "$RUNNER_OS" | tr '[:upper:]' '[:lower:]')
bash ci/install-dependencies-${os}.sh
env:
EXCLUDE_OPTIONAL: ${{ matrix.EXCLUDE_OPTIONAL }}
- 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: |
if [ "$RUNNER_OS" != "Windows" ]; then
bash ci/config-gmt-unix.sh
else
bash ci/config-gmt-windows.sh
fi
- name: Compile GMT (Linux/macOS)
run: |
mkdir build
cd build
cmake -G Ninja ..
cmake --build .
if: runner.os != 'Windows'
- name: Compile GMT (Windows)
shell: cmd
run: |
mkdir build
cd build
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake -G Ninja .. -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build .
if: runner.os == 'Windows'
- name: Download cached GMT remote data from GitHub Artifacts
run: |
gh run download -n gmt-cache -D ~/.gmt/static/
ls -lRh ~/.gmt/static/
env:
GH_TOKEN: ${{ github.token }}
- name: Install GMT
run: |
cd build
cmake --build . --target install
# Add GMT PATH to bin
echo "${INSTALLDIR}/bin" >> $GITHUB_PATH
- name: Check a few simple commands
run: bash ci/simple-gmt-tests.sh
- name: Check a few simple commands (Windows)
shell: cmd
run: call ci/simple-gmt-tests.bat
if: runner.os == 'Windows'