Skip to content

CI: Deduplicate the GMT cache download step into a composite action - #4858

Open
seisman wants to merge 9 commits into
mainfrom
ci/composite-action-poc
Open

CI: Deduplicate the GMT cache download step into a composite action#4858
seisman wants to merge 9 commits into
mainfrom
ci/composite-action-poc

Conversation

@seisman

@seisman seisman commented Aug 25, 2026

Copy link
Copy Markdown
Member

What this does

Six workflows each carried their own copy of the step that downloads the gmt-cache
artifact into ~/.gmt: benchmarks, ci_docs, ci_doctests, ci_tests,
ci_tests_dev and ci_tests_legacy.

They now share .github/actions/download-gmt-cache:

      - name: Download remote data from GitHub
        uses: ./.github/actions/download-gmt-cache

Possible follow-ups, deliberately not done here

  • Get current week number of year (4 workflows) and make install (5 workflows) are
    also duplicated, but they are 1-2 lines each, so wrapping them likely costs more in
    indirection than it saves.

Idea by @seisman, and implemented by Claude Code

Six workflows (benchmarks, ci_docs, ci_doctests, ci_tests, ci_tests_dev and
ci_tests_legacy) each carried their own copy of the step that downloads the
'gmt-cache' artifact into ~/.gmt. All six were functionally identical; the only
differences were comment drift.

Replace them with a local composite action at
.github/actions/download-gmt-cache, which removes 48 lines and adds 6.

Note that composite actions do not inherit the job's 'defaults.run.shell', so the
action sets 'shell: bash -l {0}' explicitly to match the workflows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seisman seisman added maintenance Boring but important stuff for the core devs discussions Need more discussion before taking further actions labels Aug 25, 2026
seisman and others added 4 commits August 25, 2026 11:33
The 'Ensure hyphens are not used in names of directories and Python files' step in
style_checks.yaml greps every tracked directory, so '.github/actions/download-gmt-cache'
would have failed CI. Rename it to 'download_gmt_cache'.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@seisman seisman added this to the 0.20.0 milestone Aug 27, 2026
@seisman

seisman commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

@weiji14 Do you have any comments on this PR?

@weiji14

weiji14 commented Aug 27, 2026

Copy link
Copy Markdown
Member

The code itself looks fine, I'm just not sure how I feel yet about more AI-assisted contributions, whether it should be encouraged or not (should talk about in #4759).

@seisman seisman changed the title POC: Deduplicate the GMT cache download step into a composite action CI: Deduplicate the GMT cache download step into a composite action Aug 27, 2026
@seisman
seisman marked this pull request as ready for review August 27, 2026 05:18
@seisman seisman added skip-changelog Skip adding Pull Request to changelog needs review This PR has higher priority and needs review. and removed discussions Need more discussion before taking further actions labels Aug 27, 2026
@seisman

seisman commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

I'm just not sure how I feel yet about more AI-assisted contributions, whether it should be encouraged or not (should talk about in #4759).

Personally, I encourage AI assistance in contributing, but the contributor should be able to understand and explain the changes. Anyway, it should be discussed in #4759.

Comment thread .github/workflows/benchmarks.yml Outdated
Comment thread .github/workflows/ci_docs.yml Outdated
Comment thread .github/workflows/ci_doctests.yaml Outdated
Comment thread .github/workflows/ci_tests.yaml Outdated
Comment thread .github/workflows/ci_tests_dev.yaml Outdated
Comment thread .github/workflows/ci_tests_legacy.yaml Outdated
seisman and others added 3 commits August 31, 2026 09:22
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs needs review This PR has higher priority and needs review. skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants