Skip to content

Commit

Permalink
Merge branch 'master' into psconvert-no-file-dup
Browse files Browse the repository at this point in the history
  • Loading branch information
joa-quim committed Jul 22, 2024
2 parents 76e0140 + 3c45afb commit b680e9c
Show file tree
Hide file tree
Showing 490 changed files with 1,712 additions and 1,696 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ assignees: ''

**Before release**:

- [ ] check if there are new [SCM releases](https://doi.org/10.5281/zenodo.1243862)
- [ ] check if all tests pass on macOS, Linux and Windows
- [ ] check if other GMT-derived projects work well
- [ ] MB-System (@PaulWessel)
Expand Down
5 changes: 5 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Codecov configuration file
#
# Reference: https://docs.codecov.com/docs/codecovyml-reference
#
comment: false
14 changes: 11 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "weekly"
day: "tuesday"
interval: "monthly"
# Allow up to 2 open pull requests at a time
open-pull-requests-limit: 2
# Specify labels for pull requests
labels:
- "maintenance"

- package-ecosystem: "pip"
directory: "/doc/rst/"
schedule:
interval: "monthly"
# Allow up to 2 open pull requests at a time
open-pull-requests-limit: 2
# Specify labels for pull requests
Expand Down
69 changes: 31 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@
name: Build

on:
pull_request:
paths-ignore:
- 'doc/**'
- '!doc/**/CMakeLists.txt'
push:
branches:
- master
- 6.[0-9]+
paths-ignore:
- 'doc/**'
- '!doc/**/CMakeLists.txt'
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
shell: bash -el {0}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -57,15 +63,17 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.6

- name: Setup vcpkg (Windows)
uses: dawidd6/action-download-artifact@v3.1.4
with:
workflow: ci-caches.yml
name: vcpkg-cache
path: C:\vcpkg\installed\
run: gh run download -n vcpkg-cache -D C:/vcpkg/installed/
if: runner.os == 'Windows'
env:
GH_TOKEN: ${{ github.token }}

- name: Setup conda (macOS)
uses: conda-incubator/setup-miniconda@v3
if: runner.os == 'macOS'

- name: Install GMT dependencies
run: |
Expand All @@ -76,16 +84,10 @@ jobs:
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: Download GSHHG and DCW data
run: gh run download -n coastline-cache -D coastline
env:
GH_TOKEN: ${{ github.token }}

- name: Configure GMT
run: |
Expand Down Expand Up @@ -113,27 +115,18 @@ jobs:
cmake --build .
if: runner.os == 'Windows'

- name: Download cached GMT remote data from GitHub Artifacts
uses: dawidd6/action-download-artifact@v3.1.4
with:
workflow: ci-caches.yml
name: gmt-cache
path: .gmt

# Move downloaded files to ~/.gmt directory and list them
- name: Move and list downloaded remote files
run: |
mkdir -p ~/.gmt
mv .gmt/* ~/.gmt
ls -lRh ~/.gmt
- name: Install GMT
run: |
cd 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/
env:
GH_TOKEN: ${{ github.token }}

- name: Check a few simple commands
run: bash ci/simple-gmt-tests.sh

Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# This workflow checks the links in plaintext files in the repository
# Check links in plaintext files in the repository
#
# This workflow runs the lychee tool to check all links in plaintext files. It will
# create an issue if broken links are found.
#
# It is scheduled to run weekly at 12 noon every Sunday.
#
name: Check Links

on:
# Uncomment the 'pull_request' line below to trigger the workflow in PR
# pull_request:
workflow_dispatch:
# Schedule runs on 12 noon every Sunday
schedule:
- cron: '0 12 * * 0'
Expand All @@ -12,13 +19,15 @@ jobs:
check_links:
name: Check Links
runs-on: ubuntu-latest
if: github.repository == 'GenericMappingTools/gmt'

steps:
- name: Checkout the repository
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.6

- name: Link Checker
uses: lycheeverse/lychee-action@v1.9.3
id: lychee
uses: lycheeverse/lychee-action@v1.10.0
with:
# 429: Too many requests
args: >
Expand All @@ -38,19 +47,20 @@ jobs:
--exclude ^http://www.eumetsat.int
--exclude ^http://nsis.sourceforge.io
--exclude ^https://www.ethnologue.com
--exclude ^https://linux.die.net/man/3/printf
--verbose
**/*.rst
**/*.rst_
**/*.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Create Issue From File
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report on ${{ steps.date.outputs.date }}
content-filepath: ./lychee/out.md
if: env.lychee_exit_code != 0
run: |
title="Link Checker Report on ${{ steps.date.outputs.date }}"
gh issue create --title "$title" --body-file ./lychee/out.md
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
64 changes: 51 additions & 13 deletions .github/workflows/ci-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
# Create CI caches for:
#
# 1. GMT remote data for building documentation and running tests
# 2. vcpkg libraries on Windows
# 2. GMT GSHHG and DCW datasets
# 3. vcpkg libraries on Windows
#
name: GMT CI Caches

on:
# Uncomment the "push:" line to manually re-cache data artifacts in pushes
#push:
# Uncomment the 'pull_request:' line to manually re-cache data artifacts in PRs
# pull_request:
pull_request:
# Make any changes to the following files to refresh the cache in PRs
paths:
- '.github/workflows/ci-caches.yml'
workflow_dispatch:
# Schedule runs on 12 noon every Sunday
schedule:
- cron: '0 12 * * 0'
Expand All @@ -22,12 +24,22 @@ concurrency:
jobs:
data_cache:
name: Cache GMT data
# We have to use macOS, because Linux/Windows agents may fail to download
runs-on: macOS-latest
runs-on: macos-latest
defaults:
run:
shell: bash -l {0}

steps:
- name: Install GMT
run: brew install gmt
uses: mamba-org/setup-micromamba@v1.9.0
with:
environment-name: gmt
condarc: |
channels:
- conda-forge
- nodefaults
create-args: >-
gmt=6.5.0
- name: Download remote data
run: |
Expand Down Expand Up @@ -76,28 +88,54 @@ jobs:
gmt which -Ga $data
gmt which -Ga $data
# Download cache files multiple times to make sure all are downloaded
# Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437.
mv ~/.gmt/gmt_data_server.txt ~/.gmt/server/
mv ~/.gmt/gmt_hash_server.txt ~/.gmt/server/
gmt get -Dcache
gmt get -Dcache
gmt get -Dcache
# Workaroud for https://github.com/GenericMappingTools/gmt/issues/8437.
mkdir ~/.gmt/static/
mv ~/.gmt/server ~/.gmt/static/
mv ~/.gmt/cache ~/.gmt/static/
# check files
ls -R ~/.gmt
ls -lR ~/.gmt
# Upload the downloaded files as artifacts to GitHub
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v4
with:
name: gmt-cache
path: |
~/.gmt/cache
~/.gmt/server
path: ~/.gmt/static

coastline_cache:
name: Cache GSHHG and DCW datasets
runs-on: ubuntu-latest
env:
COASTLINEDIR: ${{ github.workspace }}/coastline

steps:
- name: Checkout
uses: actions/checkout@v4.1.6

- name: Download GSHHG and DCW datasets
run: bash ci/download-coastlines.sh
env:
COASTLINEDIR: ${{ env.COASTLINEDIR }}

- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v4
with:
name: coastline-cache
path: ${{ env.COASTLINEDIR }}

vcpkg_cache:
name: Cache vcpkg libraries
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.6

- name: Install vcpkg libraries
run: bash ci/install-dependencies-windows.sh
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/code-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ on:
branches:
- master
- '[0-9]+.[0-9]+'
paths:
- 'src/**'
- 'cmake/**'
- '**/*.sh'
- '.github/workflows/code-validator.yml'
pull_request:
paths-ignore:
- 'doc/**'
- '!doc/**/CMakeLists.txt'
paths:
- 'src/**'
- 'cmake/**'
- '**/*.sh'
- '.github/workflows/code-validator.yml'

name: Code Validator

Expand All @@ -18,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3.6.0
uses: actions/checkout@v4.1.6

- name: Check PSL_strings.h
run: |
Expand Down
Loading

0 comments on commit b680e9c

Please sign in to comment.