Skip to content

Commit 274a2ca

Browse files
committed
Merge branch 'main' into wrap-module-instructions
2 parents f2a86b8 + f56c922 commit 274a2ca

Some content is hidden

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

54 files changed

+464
-251
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484

8585
# Run the benchmark tests
8686
- name: Run benchmarks
87-
uses: CodSpeedHQ/action@6b43a0cd438f6ca5ad26f9ed03ed159ed2df7da9 # v4.1.1
87+
uses: CodSpeedHQ/action@6a8e2b874c338bf81cc5e8be715ada75908d3871 # v4.3.4
8888
with:
8989
mode: "instrumentation"
9090
# 'bash -el -c' is needed to use the custom shell.

.github/workflows/cache_data.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474

7575
# Upload the downloaded files as artifacts to GitHub
7676
- name: Upload artifacts to GitHub
77-
uses: actions/upload-artifact@v4.6.2
77+
uses: actions/upload-artifact@v5.0.0
7878
with:
7979
name: gmt-cache
8080
include-hidden-files: true

.github/workflows/cache_dvc.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Cache baseline images tracked by DVC and upload as artifacts.
2+
#
3+
# This workflow downloads dvc cache needed by PyGMT tests and uploads them as workflow
4+
# artifacts, which can then be accessed by other GitHub Actions workflows.
5+
#
6+
# This workflow serves as a workaround for the DagsHub authentication issue that
7+
# prevents PRs from forks to access the DVC remote.
8+
# Related issue: https://github.com/GenericMappingTools/pygmt/issues/4147
9+
#
10+
# It is scheduled to run every Sunday at 12:00 (UTC) and on the main branch if there are
11+
# any changes to the baseline images.
12+
#
13+
name: Cache DVC
14+
15+
on:
16+
push:
17+
branches: [ main ]
18+
paths:
19+
- 'pygmt/tests/baseline/*.png.dvc'
20+
# pull_request: # For testing only.
21+
workflow_dispatch:
22+
# Schedule runs on 12 noon every Sunday
23+
schedule:
24+
- cron: '0 12 * * 0'
25+
26+
permissions: {}
27+
28+
jobs:
29+
dvc_cache:
30+
name: Cache DVC baseline images
31+
runs-on: ubuntu-latest
32+
defaults:
33+
run:
34+
shell: bash -l {0}
35+
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v5.0.0
39+
with:
40+
# fetch all history so that setuptools-scm works
41+
fetch-depth: 0
42+
persist-credentials: false
43+
44+
- name: Setup data version control (DVC)
45+
uses: iterative/setup-dvc@175771be1dc3d119268e00a896b52a4b77decb5e # v1.2.0
46+
47+
- name: Pull baseline image data from dvc remote
48+
env:
49+
DAGSHUB_TOKEN: ${{ secrets.DAGSHUB_TOKEN }}
50+
run: |
51+
dvc remote modify upstream url https://${DAGSHUB_TOKEN}@dagshub.com/GenericMappingTools/pygmt.dvc --local
52+
dvc pull --no-run-cache --verbose && ls -lhR pygmt/tests/baseline/
53+
54+
- name: Upload DVC cache as artifacts to GitHub
55+
uses: actions/upload-artifact@v5.0.0
56+
with:
57+
name: dvc-cache
58+
include-hidden-files: true
59+
path: .dvc/cache/

.github/workflows/check-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
- name: Link Checker
4242
id: lychee
43-
uses: lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2 # v2.6.1
43+
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
4444
with:
4545
fail: false # Don't fail action on broken links
4646
output: /tmp/lychee-out.md

.github/workflows/ci_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
cd ../..
152152
153153
- name: Upload PDF as artifact for previewing on pull requests
154-
uses: actions/upload-artifact@v4.6.2
154+
uses: actions/upload-artifact@v5.0.0
155155
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
156156
with:
157157
name: artifact-pygmt-docs-pdf

.github/workflows/ci_tests.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
GH_TOKEN: ${{ github.token }}
152152

153153
- name: Install uv
154-
uses: astral-sh/setup-uv@3259c6206f993105e3a61b142c2d97bf4b9ef83d # v7.1.0
154+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
155155
with:
156156
activate-environment: true
157157
python-version: ${{ matrix.python-version }}
@@ -163,12 +163,23 @@ jobs:
163163
164164
# Pull baseline image data from dvc remote (DAGsHub)
165165
- name: Pull baseline image data from dvc remote
166+
id: dvc-pull
167+
continue-on-error: true
166168
run: |
167169
uv run dvc remote modify upstream url https://${DAGSHUB_TOKEN}@dagshub.com/GenericMappingTools/pygmt.dvc --local
168170
uv run dvc pull --no-run-cache --verbose && ls -lhR pygmt/tests/baseline/
169171
env:
170172
DAGSHUB_TOKEN: ${{ secrets.DAGSHUB_TOKEN }}
171173

174+
- name: Download DVC cache as artifacts from GitHub
175+
if: steps.dvc-pull.outcome == 'failure'
176+
run: |
177+
rm -rvf .dvc/cache/
178+
gh run download --name dvc-cache --dir .dvc/cache/
179+
uv run dvc checkout --verbose
180+
env:
181+
GH_TOKEN: ${{ github.token }}
182+
172183
# Install the package that we want to test
173184
- name: Install the package
174185
run: make install
@@ -179,7 +190,7 @@ jobs:
179190

180191
# Upload diff images on test failure
181192
- name: Upload diff images if any test fails
182-
uses: actions/upload-artifact@v4.6.2
193+
uses: actions/upload-artifact@v5.0.0
183194
if: failure()
184195
with:
185196
name: artifact-${{ matrix.os }}-${{ matrix.python-version }}

.github/workflows/ci_tests_dev.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,23 @@ jobs:
161161

162162
# Pull baseline image data from dvc remote (DAGsHub)
163163
- name: Pull baseline image data from dvc remote
164+
id: dvc-pull
165+
continue-on-error: true
164166
run: |
165167
dvc remote modify upstream url https://${DAGSHUB_TOKEN}@dagshub.com/GenericMappingTools/pygmt.dvc --local
166168
dvc pull --no-run-cache --verbose && ls -lhR pygmt/tests/baseline/
167169
env:
168170
DAGSHUB_TOKEN: ${{ secrets.DAGSHUB_TOKEN }}
169171

172+
- name: Download DVC cache as artifacts from GitHub
173+
if: steps.dvc-pull.outcome == 'failure'
174+
run: |
175+
rm -rvf .dvc/cache/
176+
gh run download --name dvc-cache --dir .dvc/cache/
177+
dvc checkout --verbose
178+
env:
179+
GH_TOKEN: ${{ github.token }}
180+
170181
# Download cached remote files (artifacts) from GitHub
171182
- name: Download remote data from GitHub
172183
run: |
@@ -190,7 +201,7 @@ jobs:
190201

191202
# Upload diff images on test failure
192203
- name: Upload diff images if any test fails
193-
uses: actions/upload-artifact@v4.6.2
204+
uses: actions/upload-artifact@v5.0.0
194205
if: ${{ failure() }}
195206
with:
196207
name: artifact-${{ matrix.os }}-GMT-${{ matrix.gmt_git_ref }}

.github/workflows/publish-to-pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
ls -lh dist/
7575
7676
- name: Store the distribution packages
77-
uses: actions/upload-artifact@v4.6.2
77+
uses: actions/upload-artifact@v5.0.0
7878
with:
7979
name: python-package-distributions
8080
path: dist/
@@ -93,7 +93,7 @@ jobs:
9393

9494
steps:
9595
- name: Download all the dists
96-
uses: actions/download-artifact@v5.0.0
96+
uses: actions/download-artifact@v6.0.0
9797
with:
9898
name: python-package-distributions
9999
path: dist/
@@ -117,7 +117,7 @@ jobs:
117117

118118
steps:
119119
- name: Download all the dists
120-
uses: actions/download-artifact@v5.0.0
120+
uses: actions/download-artifact@v6.0.0
121121
with:
122122
name: python-package-distributions
123123
path: dist/

.github/workflows/welcome.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Greet first-time contributors.
2+
#
3+
# It runs in issues and pull requests from forks.
24

35
name: Greet First-Time Contributors
46

@@ -13,10 +15,13 @@ on:
1315
permissions:
1416
issues: write
1517
pull-requests: write
18+
id-token: write
19+
contents: read
1620

1721
jobs:
1822
greeting:
1923
name: Greet First-Time Contributors
24+
if: github.event_name == 'issues' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
2025
runs-on: ubuntu-latest
2126

2227
steps:

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The following people have contributed code and/or documentation to the project
2525
| [Tyler Newton](https://www.tnewton.com/) | [0000-0002-1560-6553](https://orcid.org/0000-0002-1560-6553) | University of Oregon, USA |
2626
| [Wei Ji Leong](https://github.com/weiji14) | [0000-0003-2354-1988](https://orcid.org/0000-0003-2354-1988) | Development Seed, USA |
2727
| [William Schlitzer](https://github.com/willschlitzer) | [0000-0002-5843-2282](https://orcid.org/0000-0002-5843-2282) | Unaffiliated |
28+
| [Xingchen He](https://github.com/Chuan1937) | [0009-0004-7182-2252](https://orcid.org/0009-0004-7182-2252) | Chengdu University of Technology, China |
2829
| [Yohai Magen](https://github.com/yohaimagen) | [0000-0002-4892-4013](https://orcid.org/0000-0002-4892-4013) | Tel Aviv University, Israel |
2930
| [Yvonne Fröhlich](https://github.com/yvonnefroehlich) | [0000-0002-8566-0619](https://orcid.org/0000-0002-8566-0619) | Unaffiliated |
3031

0 commit comments

Comments
 (0)