Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/actions/checkout-lfs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Check out the Git LFS objects, with the objects cached by GitHub Actions
#
# The Git LFS objects (i.e., the baseline images for image comparison tests) are
# restored from the GitHub Actions cache, so that they are fetched from the Git LFS
# server only when they are missing from the cache, which saves the Git LFS bandwidth.
#
# This action must be used after the "actions/checkout" step, and that step must set
# "lfs: false" (the default), otherwise the objects are fetched from the Git LFS server
# before the cache can be restored.
#
name: Checkout Git LFS objects
description: Check out the Git LFS objects, restoring them from the GitHub Actions cache

runs:
using: composite
steps:
- name: Get the list of Git LFS objects
shell: bash
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id

- name: Cache the Git LFS objects
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 # zizmor: ignore[cache-poisoning]
with:
path: .git/lfs
key: git-lfs-${{ hashFiles('.lfs-assets-id') }}
# Fall back to the most recent cache so Git LFS only fetches missing objects.
restore-keys: git-lfs-

- name: Checkout the Git LFS objects
shell: bash
run: git lfs pull
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
directories:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- "/"
- "/.github/actions/*"
schedule:
# Check for updates to GitHub Actions on Tuesdays
interval: "weekly"
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ on:
branches: [ main ]
paths:
- 'pygmt/**'
- '.github/actions/checkout-lfs/action.yml'
- '.github/workflows/ci_tests.yaml'
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- 'pygmt/**'
- '.github/actions/checkout-lfs/action.yml'
- '.github/workflows/ci_tests.yaml'
workflow_dispatch:
release:
Expand Down Expand Up @@ -112,7 +114,7 @@ jobs:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false
lfs: true
lfs: false

- name: Get current week number of year
id: date
Expand Down Expand Up @@ -143,6 +145,9 @@ jobs:
pytest-mpl
pytest-rerunfailures

- name: Checkout the Git LFS (i.e., the baseline images) objects
uses: $/.github/actions/checkout-lfs

# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
uses: $/.github/actions/download-gmt-cache
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci_tests_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
types: [ opened, reopened, labeled, synchronize ]
paths:
- 'pygmt/**'
- '.github/actions/checkout-lfs/action.yml'
- '.github/workflows/ci_tests_dev.yaml'
workflow_dispatch:
# Schedule tests on Monday/Wednesday/Friday
Expand Down Expand Up @@ -56,7 +57,7 @@ jobs:
# fetch all history so that setuptools-scm works
fetch-depth: 0
persist-credentials: false
lfs: true
lfs: false

- name: Get current week number of year
id: date
Expand Down Expand Up @@ -154,6 +155,9 @@ jobs:
- name: List installed packages
run: micromamba list

- name: Checkout the Git LFS (i.e., the baseline images) objects
uses: $/.github/actions/checkout-lfs

# Download cached remote files (artifacts) from GitHub
- name: Download remote data from GitHub
uses: $/.github/actions/download-gmt-cache
Expand Down
Loading