Skip to content

Commit 2851af8

Browse files
committed
Merge branch 'main' into refactor/virtualfile_in
2 parents 5eeb37b + 280595e commit 2851af8

File tree

97 files changed

+1345
-640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1345
-640
lines changed

.github/workflows/benchmarks.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ concurrency:
2323
group: ${{ github.workflow }}-${{ github.ref }}
2424
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2525

26+
permissions: {}
27+
2628
jobs:
2729
benchmarks:
2830
runs-on: ubuntu-latest
@@ -38,6 +40,7 @@ jobs:
3840
with:
3941
# fetch all history so that setuptools-scm works
4042
fetch-depth: 0
43+
persist-credentials: false
4144

4245
- name: Get current week number of year
4346
id: date
@@ -82,7 +85,7 @@ jobs:
8285

8386
# Run the benchmark tests
8487
- name: Run benchmarks
85-
uses: CodSpeedHQ/action@v3.4.0
88+
uses: CodSpeedHQ/action@v3.5.0
8689
with:
8790
# 'bash -el -c' is needed to use the custom shell.
8891
# See https://github.com/CodSpeedHQ/action/issues/65.

.github/workflows/cache_data.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ on:
2525
schedule:
2626
- cron: '0 12 * * 0'
2727

28+
permissions: {}
29+
2830
jobs:
2931
gmt_cache:
3032
name: Cache GMT artifacts
@@ -40,6 +42,7 @@ jobs:
4042
with:
4143
# fetch all history so that setuptools-scm works
4244
fetch-depth: 0
45+
persist-credentials: false
4346

4447
# Install Micromamba with conda-forge dependencies
4548
- name: Setup Micromamba

.github/workflows/check-links.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
schedule:
1616
- cron: '0 12 * * 0'
1717

18+
permissions:
19+
issues: write
20+
1821
jobs:
1922
check_links:
2023
name: Check Links
@@ -26,12 +29,14 @@ jobs:
2629
uses: actions/checkout@v4.2.2
2730
with:
2831
path: repository
32+
persist-credentials: false
2933

3034
- name: Checkout the documentation
3135
uses: actions/checkout@v4.2.2
3236
with:
3337
ref: gh-pages
3438
path: documentation
39+
persist-credentials: false
3540

3641
- name: Link Checker
3742
id: lychee
@@ -45,11 +50,14 @@ jobs:
4550
--exclude "^https://docs.generic-mapping-tools.org/6.[0-9]?/%s$"
4651
--exclude "^https://docs.generic-mapping-tools.org/6.[0-9]?/%3Cmodule-name%3E.html$"
4752
--exclude "^https://doi.org"
53+
--exclude "^https://github.com/%7Brepository%7D"
4854
--exclude "^https://github.com/GenericMappingTools/gmt/releases/tag/X.Y.Z$"
4955
--exclude "^https://github.com/GenericMappingTools/pygmt/edit"
5056
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/new"
5157
--exclude "^https://github.com/GenericMappingTools/pygmt/pull/[0-9]*$"
5258
--exclude "^https://github.com/GenericMappingTools/pygmt/issues/[0-9]*$"
59+
--exclude "^https://github.com/GenericMappingTools/pygmt/releases/download/%7B%7Bpath%7D%7D/pygmt-docs.pdf"
60+
--exclude "^https://github.com/GenericMappingTools/pygmt/releases/download/%7B%7Bpath%7D%7D/pygmt-docs.zip"
5361
--exclude "^https://github.com/GenericMappingTools/pygmt/releases/tag/%7B%7Bpath%7D%7D"
5462
--exclude "^https://hackmd.io/@pygmt"
5563
--exclude "^https://test.pypi.org/simple/"
@@ -58,6 +66,8 @@ jobs:
5866
--exclude "^https://www.pygmt.org/%7B%7Bpath%7D%7D"
5967
--exclude "^https://www.researchgate.net/"
6068
--exclude "^https://zenodo.org/badge/DOI/"
69+
--exclude-path "repository/doc/**/*.rst"
70+
--exclude-path "repository/doc/**/*.md"
6171
--verbose
6272
"repository/**/*.rst"
6373
"repository/**/*.md"
@@ -69,10 +79,11 @@ jobs:
6979
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
7080

7181
- name: Create Issue From File
72-
if: env.lychee_exit_code != 0
82+
if: ${{ steps.lychee.outputs.exit_code }} != 0
7383
run: |
7484
cd repository/
75-
title="Link Checker Report on ${{ steps.date.outputs.date }}"
85+
title="Link Checker Report on ${CURRENT_DATE}"
7686
gh issue create --title "$title" --body-file /tmp/lychee-out.md
7787
env:
7888
GH_TOKEN: ${{ github.token }}
89+
CURRENT_DATE: ${{ steps.date.outputs.date }}

.github/workflows/ci_docs.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
#
33
# This workflow builds the documentation on Linux/macOS/Windows.
44
#
5-
# It is run on every commit to the main and pull request branches, and also
6-
# when a new release is published.
7-
# In draft pull requests, only the job on Linux is triggered to save on
8-
# Continuous Integration resources.
5+
# It is run on every commit to the main and pull request branches, and also when a new
6+
# release is published. In draft pull requests, only the job on Linux is triggered to
7+
# save on Continuous Integration resources.
98
#
109
# On the main branch, the workflow also handles the documentation deployment:
1110
#
12-
# * Updating the development documentation by pushing the built HTML pages
13-
# from the main branch onto the dev folder of the gh-pages branch.
11+
# * Updating the development documentation by pushing the built HTML pages from the main
12+
# branch onto the dev folder of the gh-pages branch.
1413
# * Updating the latest documentation link to the new release.
1514
#
1615
name: Docs
@@ -43,6 +42,9 @@ concurrency:
4342
group: ${{ github.workflow }}-${{ github.ref }}
4443
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
4544

45+
permissions:
46+
contents: write
47+
4648
jobs:
4749
docs:
4850
name: ${{ matrix.os }}
@@ -73,6 +75,7 @@ jobs:
7375
with:
7476
# fetch all history so that setuptools-scm works
7577
fetch-depth: 0
78+
persist-credentials: false
7679

7780
- name: Get current week number of year
7881
id: date
@@ -159,10 +162,11 @@ jobs:
159162
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest'
160163

161164
- name: Upload the HTML ZIP archive and PDF as release assets
162-
run: gh release upload ${{ github.ref_name }} doc/_build/pygmt-docs.zip doc/_build/pygmt-docs.pdf
165+
run: gh release upload ${REF_NAME} doc/_build/pygmt-docs.zip doc/_build/pygmt-docs.pdf
163166
if: github.event_name == 'release' && matrix.os == 'ubuntu-latest'
164167
env:
165168
GH_TOKEN: ${{ github.token }}
169+
REF_NAME: ${{ github.ref_name }}
166170

167171
- name: Checkout the gh-pages branch
168172
uses: actions/checkout@v4.2.2
@@ -172,6 +176,7 @@ jobs:
172176
path: deploy
173177
# Download the entire history
174178
fetch-depth: 0
179+
persist-credentials: true
175180
if: (github.event_name == 'release' || github.event_name == 'push') && (matrix.os == 'ubuntu-latest')
176181

177182
- name: Push the built HTML to gh-pages

.github/workflows/ci_doctests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.ref }}
1919
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2020

21+
permissions: {}
22+
2123
jobs:
2224
test:
2325
name: ${{ matrix.os }}
@@ -39,6 +41,7 @@ jobs:
3941
with:
4042
# fetch all history so that setuptools-scm works
4143
fetch-depth: 0
44+
persist-credentials: false
4245

4346
# Install Micromamba with conda-forge dependencies
4447
- name: Setup Micromamba

.github/workflows/ci_tests.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
with:
109109
# fetch all history so that setuptools-scm works
110110
fetch-depth: 0
111+
persist-credentials: false
111112

112113
- name: Get current week number of year
113114
id: date
@@ -151,7 +152,7 @@ jobs:
151152
GH_TOKEN: ${{ github.token }}
152153

153154
- name: Install uv
154-
uses: astral-sh/setup-uv@v5.2.2
155+
uses: astral-sh/setup-uv@v5.4.0
155156
with:
156157
python-version: ${{ matrix.python-version }}
157158

@@ -182,7 +183,7 @@ jobs:
182183

183184
# Upload coverage to Codecov
184185
- name: Upload coverage to Codecov
185-
uses: codecov/codecov-action@v5.3.1
186+
uses: codecov/codecov-action@v5.4.0
186187
if: success() || failure()
187188
with:
188189
use_oidc: true

.github/workflows/ci_tests_dev.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ concurrency:
2828
group: ${{ github.workflow }}-${{ github.ref }}
2929
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
3030

31+
permissions: {}
32+
3133
jobs:
3234
test_gmt_dev:
3335
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_git_ref }}
@@ -50,6 +52,7 @@ jobs:
5052
with:
5153
# fetch all history so that setuptools-scm works
5254
fetch-depth: 0
55+
persist-credentials: false
5356

5457
- name: Get current week number of year
5558
id: date
@@ -96,6 +99,7 @@ jobs:
9699
repository: 'GenericMappingTools/gmt'
97100
ref: ${{ matrix.gmt_git_ref }}
98101
path: 'gmt'
102+
persist-credentials: false
99103

100104
# Build GMT from source on Linux/macOS, script is adapted from
101105
# https://github.com/GenericMappingTools/gmt/blob/6.5.0/ci/build-gmt.sh
@@ -105,7 +109,7 @@ jobs:
105109
mkdir build
106110
cd build
107111
cmake -G Ninja .. \
108-
-DCMAKE_INSTALL_PREFIX=${{ env.GMT_INSTALL_DIR }} \
112+
-DCMAKE_INSTALL_PREFIX=${GMT_INSTALL_DIR} \
109113
-DCMAKE_BUILD_TYPE=Release \
110114
-DGMT_ENABLE_OPENMP=TRUE \
111115
-DGMT_USE_THREADS=TRUE
@@ -125,7 +129,7 @@ jobs:
125129
cd build
126130
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
127131
cmake -G Ninja .. ^
128-
-DCMAKE_INSTALL_PREFIX=${{ env.GMT_INSTALL_DIR }} ^
132+
-DCMAKE_INSTALL_PREFIX=%GMT_INSTALL_DIR% ^
129133
-DCMAKE_BUILD_TYPE=Release ^
130134
-DCMAKE_PREFIX_PATH=${{ env.MAMBA_ROOT_PREFIX }}\envs\pygmt\Library ^
131135
-DGMT_ENABLE_OPENMP=TRUE ^

.github/workflows/ci_tests_legacy.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ concurrency:
2626
group: ${{ github.workflow }}-${{ github.ref }}
2727
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2828

29+
permissions: {}
30+
2931
jobs:
3032
test:
3133
name: ${{ matrix.os }} - GMT ${{ matrix.gmt_version }}
@@ -48,6 +50,7 @@ jobs:
4850
with:
4951
# fetch all history so that setuptools-scm works
5052
fetch-depth: 0
53+
persist-credentials: false
5154

5255
# Install Micromamba with conda-forge dependencies
5356
- name: Setup Micromamba

.github/workflows/dvc-diff.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414
paths:
1515
- 'pygmt/tests/baseline/*.png.dvc'
1616

17+
permissions: {}
18+
1719
jobs:
1820
dvc-diff:
1921
name: DVC image diff
@@ -25,6 +27,7 @@ jobs:
2527
with:
2628
# fetch all history so that dvc diff works
2729
fetch-depth: 0
30+
persist-credentials: false
2831

2932
- name: Setup data version control (DVC)
3033
uses: iterative/setup-dvc@v1.1.2
@@ -53,6 +56,7 @@ jobs:
5356
- name: Generate the image diff report
5457
env:
5558
repo_token: ${{ github.token }}
59+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
5660
run: |
5761
echo -e "## Summary of changed images\n" > report.md
5862
echo -e "This is an auto-generated report of images that have changed on the DVC remote\n" >> report.md
@@ -94,7 +98,7 @@ jobs:
9498
echo -e "</details>\n" >> report.md
9599
96100
# Mention git commit SHA in the report
97-
echo -e "Report last updated at commit ${{ github.event.pull_request.head.sha }}" >> report.md
101+
echo -e "Report last updated at commit ${PR_HEAD_SHA}" >> report.md
98102
99103
# create/update PR comment
100104
cml comment update report.md

.github/workflows/format-command.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
# This workflow is triggered in a PR if the slash command `/format` is used.
44
#
55
name: format-command
6+
67
on:
78
repository_dispatch:
89
types: [format-command]
10+
11+
permissions:
12+
contents: write
13+
914
jobs:
1015
format:
1116
runs-on: ubuntu-latest
@@ -23,9 +28,10 @@ jobs:
2328
token: ${{ steps.generate-token.outputs.token }}
2429
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
2530
ref: ${{ github.event.client_payload.pull_request.head.ref }}
31+
persist-credentials: false
2632

2733
# Setup Python environment
28-
- uses: actions/setup-python@v5.4.0
34+
- uses: actions/setup-python@v5.5.0
2935
with:
3036
python-version: '3.13'
3137

0 commit comments

Comments
 (0)