Skip to content

Commit 6e8975f

Browse files
committed
Merge remote-tracking branch 'origin/main' into mo/docker-image-comment
2 parents 5b114e3 + 6d61936 commit 6e8975f

440 files changed

Lines changed: 37855 additions & 14234 deletions

File tree

Some content is hidden

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

.changeset/friendly-worms-judge.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/quick-actors-smoke.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/sixty-cups-study.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperlane-xyz/utils": minor
3+
---
4+
5+
Add `inKubernetes` util fn.

.changeset/violet-needles-knock.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/weak-trainers-join.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: 'Check Path Changes'
2+
description: 'Check if specific paths have changed between commits'
3+
inputs:
4+
base_sha:
5+
description: 'Base commit SHA to compare from'
6+
required: true
7+
head_sha:
8+
description: 'Head commit SHA to compare to'
9+
required: true
10+
path_pattern:
11+
description: 'Path pattern to check for changes (e.g., "rust/", "solidity/")'
12+
required: true
13+
path_pattern_only:
14+
description: 'If true, checks if ONLY the specified path changed. If false, checks if ANY files in the path changed.'
15+
required: false
16+
default: 'false'
17+
outputs:
18+
has_changes:
19+
description: 'Whether the specified path has any changes'
20+
value: ${{ steps.check-changes.outputs.has_changes }}
21+
only_changes:
22+
description: 'Whether ONLY the specified path has changes (only set if path_pattern_only=true)'
23+
value: ${{ steps.check-changes.outputs.only_changes }}
24+
runs:
25+
using: 'composite'
26+
steps:
27+
- name: Check for path changes
28+
id: check-changes
29+
shell: bash
30+
run: |
31+
# Check if the specified path has any changes
32+
if git diff ${{ inputs.base_sha }}..${{ inputs.head_sha }} --name-only | grep -qE '^${{ inputs.path_pattern }}'; then
33+
echo "has_changes=true" >> $GITHUB_OUTPUT
34+
35+
# If path_pattern_only is requested, also check if ONLY this path changed
36+
if [[ "${{ inputs.path_pattern_only }}" == "true" ]]; then
37+
if ! git diff ${{ inputs.base_sha }}..${{ inputs.head_sha }} --name-only | grep -qvE '^${{ inputs.path_pattern }}'; then
38+
echo "only_changes=true" >> $GITHUB_OUTPUT
39+
echo "Only ${{ inputs.path_pattern }} changes detected."
40+
else
41+
echo "only_changes=false" >> $GITHUB_OUTPUT
42+
echo "${{ inputs.path_pattern }} changes detected along with other changes."
43+
fi
44+
fi
45+
else
46+
echo "has_changes=false" >> $GITHUB_OUTPUT
47+
if [[ "${{ inputs.path_pattern_only }}" == "true" ]]; then
48+
echo "only_changes=false" >> $GITHUB_OUTPUT
49+
fi
50+
echo "No ${{ inputs.path_pattern }} changes detected."
51+
fi
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: 'Determine Base SHA'
2+
description: 'Determine base and current SHA for different GitHub events'
3+
outputs:
4+
base_sha:
5+
description: 'The base commit SHA'
6+
value: ${{ steps.determine-base-sha.outputs.base_sha }}
7+
current_sha:
8+
description: 'The current commit SHA'
9+
value: ${{ steps.determine-base-sha.outputs.current_sha }}
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Determine BASE_SHA
14+
id: determine-base-sha
15+
shell: bash
16+
run: |
17+
if [ "${{ github.event_name }}" == "pull_request" ]; then
18+
echo "base_sha=${{ github.event.pull_request.base.sha }}" >> $GITHUB_OUTPUT
19+
echo "current_sha=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
20+
elif [ "${{ github.event_name }}" == "merge_group" ]; then
21+
echo "base_sha=${{ github.event.merge_group.base_sha }}" >> $GITHUB_OUTPUT
22+
echo "current_sha=${{ github.event.merge_group.head_sha }}" >> $GITHUB_OUTPUT
23+
elif [ "${{ github.event_name }}" == "push" ]; then
24+
echo "base_sha=${{ github.event.before }}" >> $GITHUB_OUTPUT
25+
echo "current_sha=${{ github.event.after }}" >> $GITHUB_OUTPUT
26+
else
27+
echo "base_sha=$(git rev-parse HEAD^)" >> $GITHUB_OUTPUT
28+
echo "current_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
29+
fi

.github/actions/install-cli/action.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,26 @@ inputs:
55
ref:
66
description: 'The Git ref to checkout'
77
required: true
8-
cache-provider:
9-
description: 'Choose cache provider: buildjet or github'
8+
no-cache:
9+
description: 'Whether to skip the cache'
1010
required: false
11-
default: 'buildjet'
11+
default: false
1212

1313
runs:
1414
using: 'composite'
1515
steps:
16-
- name: yarn-build
16+
- name: yarn-build-with-cache
17+
if: inputs.no-cache == 'false'
1718
uses: ./.github/actions/yarn-build-with-cache
1819
with:
1920
ref: ${{ inputs.ref }}
20-
cache-provider: ${{ inputs.cache-provider }}
21+
22+
- name: yarn-install-build-without-cache
23+
if: inputs.no-cache != 'false'
24+
shell: bash
25+
run: |
26+
yarn install
27+
yarn build
2128
2229
- name: Pack the CLI
2330
shell: bash

.github/actions/yarn-build-with-cache/action.yml

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,22 @@ inputs:
55
ref:
66
description: 'The Git ref to checkout'
77
required: true
8-
cache-provider:
9-
description: 'Choose cache provider: buildjet or github'
10-
required: false
11-
default: 'buildjet'
128

139
runs:
1410
using: 'composite'
1511
steps:
16-
# Depot transparently redirect anything bound for GitHub's Actions cache to their own for extra speed.
17-
# But this is not available to access for non-depot runners.
18-
# So we default to buildjet, and expect the workflow to set cache-provider=github if it's a depot runner.
19-
# https://depot.dev/docs/github-actions/overview#faster-caching
20-
- name: Determine Cache Provider
21-
id: determine-cache
22-
shell: bash
23-
run: echo "cache-provider=${{ inputs.cache-provider }}" >> $GITHUB_ENV
24-
25-
- name: Cache
26-
if: env.cache-provider == 'buildjet'
27-
uses: buildjet/cache@v4
28-
id: buildjet-cache
29-
with:
30-
path: |
31-
**/node_modules
32-
.yarn
33-
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}
34-
35-
- name: Cache
36-
if: env.cache-provider == 'github'
37-
uses: actions/cache@v4
38-
id: github-cache
39-
with:
40-
path: |
41-
**/node_modules
42-
.yarn
43-
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}
44-
restore-keys: |
45-
${{ runner.os }}-yarn-4.5.1-cache-
12+
- name: yarn-cache
13+
id: yarn-cache
14+
uses: ./.github/actions/yarn-cache
4615

4716
# Typically, the cache will be hit, but if there's a network error when
4817
# restoring the cache, let's run the install step ourselves.
4918
- name: Install dependencies
50-
if: steps.buildjet-cache.outputs.cache-hit != 'true' && steps.github-cache.outputs.cache-hit != 'true'
19+
if: steps.yarn-cache.outputs.cache-hit != 'true'
5120
shell: bash
5221
run: |
5322
yarn install
54-
CHANGES=$(git status -s --ignore-submodules)
23+
CHANGES=$(git status -s --ignore-submodules | grep -v "results.sarif")
5524
if [[ ! -z $CHANGES ]]; then
5625
echo "Changes found: $CHANGES"
5726
git diff
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: 'Yarn Cache'
2+
description: 'Cache yarn dependencies for faster installs'
3+
4+
inputs:
5+
cache-provider:
6+
description: 'Choose cache provider: buildjet or github'
7+
required: false
8+
default: 'github'
9+
10+
outputs:
11+
cache-hit:
12+
description: 'Whether there was a cache hit'
13+
value: ${{ steps.buildjet-cache.outputs.cache-hit || steps.github-cache.outputs.cache-hit }}
14+
15+
runs:
16+
using: 'composite'
17+
steps:
18+
# Depot transparently redirects GitHub Actions cache to their own for extra speed.
19+
# But this is not available for non-depot runners.
20+
# So we default to github, and expect the workflow to set cache-provider=buildjet if needed.
21+
# https://depot.dev/docs/github-actions/overview#faster-caching
22+
- name: Determine Cache Provider
23+
id: determine-cache
24+
shell: bash
25+
run: echo "cache-provider=${{ inputs.cache-provider }}" >> $GITHUB_ENV
26+
27+
- name: Cache (Buildjet)
28+
id: buildjet-cache
29+
if: env.cache-provider == 'buildjet'
30+
uses: buildjet/cache@v4
31+
with:
32+
path: |
33+
**/node_modules
34+
.yarn
35+
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-yarn-4.5.1-cache-
38+
39+
- name: Cache (GitHub)
40+
id: github-cache
41+
if: env.cache-provider == 'github'
42+
uses: actions/cache@v4
43+
with:
44+
path: |
45+
**/node_modules
46+
.yarn
47+
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-yarn-4.5.1-cache-

0 commit comments

Comments
 (0)