Skip to content

Commit a452682

Browse files
committed
Merge remote-tracking branch 'origin/main' into galargh/github-actions-lint
2 parents 38bb49e + 8c779d8 commit a452682

37 files changed

+264
-458
lines changed

.github/actions/setup-env/action.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Setup env
2+
description: Sets up node and pnpm
3+
4+
inputs:
5+
pnpm-version:
6+
description: Version of pnpm to install
7+
required: false
8+
default: "9"
9+
node-version:
10+
description: Version of node to install
11+
required: false
12+
default: "18"
13+
cache-save:
14+
description: Whether to save the pnpm cache
15+
required: false
16+
default: "false"
17+
outputs:
18+
cache-hit:
19+
description: Whether the cache was restored
20+
value: ${{ steps.setup-node.outputs.cache-hit || steps.cache-restore.outputs.cache-hit }}
21+
22+
runs:
23+
using: composite
24+
steps:
25+
- uses: pnpm/action-setup@v4
26+
with:
27+
version: ${{ inputs.pnpm-version }}
28+
- uses: actions/setup-node@v4
29+
id: setup-node
30+
with:
31+
node-version: ${{ inputs.node-version }}
32+
cache: ${{ inputs.cache-save == 'true' && 'pnpm' || '' }}
33+
cache-dependency-path: "**/pnpm-lock.yaml"
34+
- id: pnpm
35+
if: inputs.cache-save == 'false'
36+
run: pnpm store path --silent | xargs -I {} -0 echo "path={}" | tee -a $GITHUB_OUTPUT
37+
shell: bash
38+
- uses: actions/cache/restore@v4
39+
id: cache-restore
40+
if: inputs.cache-save == 'false'
41+
with:
42+
path: ${{ steps.pnpm.outputs.path }}
43+
key: node-cache-${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}

.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml

+2-8
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.system }}
1515
steps:
1616
- uses: actions/checkout@v4
17-
- uses: pnpm/action-setup@v4
18-
with:
19-
version: 9
20-
- uses: actions/setup-node@v4
21-
with:
22-
node-version: 18
23-
cache: "pnpm"
17+
- uses: ./.github/actions/setup-env
2418
- name: Delete pnpm-lock.yaml
2519
run: "rm pnpm-lock.yaml"
2620
- name: Install
@@ -34,7 +28,7 @@ jobs:
3428
run: pnpm test || (echo "===== Retry =====" && pnpm test)
3529
- name: Notify failures
3630
if: failure()
37-
uses: slackapi/slack-github-action@v1.18.0
31+
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
3832
with:
3933
payload: |
4034
{

.github/workflows/add-issue-to-project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
add-to-project:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/add-to-project@v0.4.0
13+
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
1414
with:
1515
project-url: https://github.com/orgs/NomicFoundation/projects/4
1616
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}

.github/workflows/add-label-to-new-issue.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
issues: write
1414
pull-requests: write
1515
steps:
16-
- uses: actions/github-script@v6
16+
- uses: actions/github-script@v7
1717
with:
1818
script: |
1919
const issue = await github.rest.issues.get({

.github/workflows/autoassign-issues.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
permissions:
1111
issues: write
1212
steps:
13-
- uses: actions/github-script@v6
13+
- uses: actions/github-script@v7
1414
with:
1515
script: |
1616
// each user has a chance of (p - (previousP ?? 0)) to be assigned

.github/workflows/autoassign-prs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
permissions:
1111
pull-requests: write
1212
steps:
13-
- uses: actions/github-script@v6
13+
- uses: actions/github-script@v7
1414
with:
1515
script: |
1616
const externalPrTriager = "kanej";

.github/workflows/cache.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Cache
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- pre-release-testing-branch
8+
- changeset-release/main
9+
- v-next
10+
paths:
11+
- ".github/workflows/cache.yml"
12+
- "**/pnpm-lock.yaml"
13+
pull_request:
14+
paths:
15+
- ".github/workflows/cache.yml"
16+
- "**/pnpm-lock.yaml"
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{github.workflow}}-${{github.ref}}
21+
cancel-in-progress: true
22+
23+
defaults:
24+
run:
25+
shell: bash
26+
27+
jobs:
28+
cache:
29+
name: Cache
30+
runs-on: ${{ matrix.runner }}
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
runner: ["ubuntu-latest", "macos-latest", "windows-latest"]
35+
steps:
36+
- uses: actions/checkout@v4
37+
- id: env
38+
uses: ./.github/actions/setup-env
39+
with:
40+
cache-save: true
41+
- name: Install
42+
if: steps.env.outputs.cache-hit != 'true'
43+
run: |
44+
for lockfile in $(find "$(pwd)" -name pnpm-lock.yaml); do
45+
pushd "$(dirname "$lockfile")"
46+
pnpm install --frozen-lockfile --prefer-offline
47+
popd
48+
done

.github/workflows/check-changeset-added.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# don't run this check in the changesets PR
2222
if: github.head_ref != 'changeset-release/main'
2323
steps:
24-
- uses: actions/github-script@v6
24+
- uses: actions/github-script@v7
2525
with:
2626
script: |
2727
const pullNumber = context.issue.number;

.github/workflows/check-docs-site.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ name: Check Docs Site
33
on:
44
push:
55
branches:
6-
- "**"
6+
- main
7+
paths:
8+
- ".github/workflows/check-docs-site.yml"
9+
- "docs/**"
10+
- "packages/**"
11+
pull_request:
12+
paths:
13+
- ".github/workflows/check-docs-site.yml"
14+
- "docs/**"
15+
- "packages/**"
716
workflow_dispatch:
817

918
concurrency:
@@ -16,13 +25,7 @@ jobs:
1625
runs-on: ubuntu-latest
1726
steps:
1827
- uses: actions/checkout@v4
19-
- uses: pnpm/action-setup@v4
20-
with:
21-
version: 9
22-
- uses: actions/setup-node@v4
23-
with:
24-
node-version: 18
25-
cache: "pnpm"
28+
- uses: ./.github/actions/setup-env
2629
- name: Install
2730
run: pnpm install --frozen-lockfile --prefer-offline
2831
- name: Install Docs

.github/workflows/close-stale-issues.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Close stale issues
13-
uses: actions/stale@v8
13+
uses: actions/stale@v9
1414
with:
1515
repo-token: ${{ secrets.GITHUB_TOKEN }}
1616
stale-issue-message: "This issue has been automatically closed due to inactivity. If you still need help, please reopen the issue and provide the requested information."

.github/workflows/e2e-tests.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: E2E tests
33
on:
44
push:
55
branches:
6-
- "main"
6+
- main
77
pull_request:
88
branches:
9-
- "main"
9+
- main
1010

1111
jobs:
1212
run-e2e:
@@ -29,12 +29,7 @@ jobs:
2929
IS_WINDOWS: ${{ matrix.os == 'windows-latest' }}
3030
steps:
3131
- uses: actions/checkout@v4
32-
- uses: pnpm/action-setup@v4
33-
with:
34-
version: 9
35-
- uses: actions/setup-node@v4
36-
with:
37-
node-version: 18
32+
- uses: ./.github/actions/setup-env
3833
- name: Run fixture-projects script
3934
run: |
4035
cd e2e

.github/workflows/hardhat-chai-matchers-ci.yml

+7-22
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ name: hardhat-chai-matchers CI
22

33
on:
44
push:
5-
branches: [$default-branch]
5+
branches:
6+
- main
67
paths:
8+
- ".github/workflows/hardhat-chai-matchers-ci.yml"
79
- "packages/hardhat-chai-matchers/**"
810
- "packages/hardhat-common/**"
911
- "config/**"
1012
pull_request:
11-
branches:
12-
- "**"
1313
paths:
14+
- ".github/workflows/hardhat-chai-matchers-ci.yml"
1415
- "packages/hardhat-chai-matchers/**"
1516
- "packages/hardhat-common/**"
1617
- "config/**"
@@ -30,13 +31,7 @@ jobs:
3031
runs-on: windows-latest
3132
steps:
3233
- uses: actions/checkout@v4
33-
- uses: pnpm/action-setup@v4
34-
with:
35-
version: 9
36-
- uses: actions/setup-node@v4
37-
with:
38-
node-version: 18
39-
cache: "pnpm"
34+
- uses: ./.github/actions/setup-env
4035
- name: Install
4136
run: pnpm install --frozen-lockfile --prefer-offline
4237
- name: Build
@@ -51,13 +46,7 @@ jobs:
5146
runs-on: macos-latest
5247
steps:
5348
- uses: actions/checkout@v4
54-
- uses: pnpm/action-setup@v4
55-
with:
56-
version: 9
57-
- uses: actions/setup-node@v4
58-
with:
59-
node-version: 18
60-
cache: "pnpm"
49+
- uses: ./.github/actions/setup-env
6150
- name: Install
6251
run: pnpm install --frozen-lockfile --prefer-offline
6352
- name: Build
@@ -75,13 +64,9 @@ jobs:
7564
node: [18, 20, 22]
7665
steps:
7766
- uses: actions/checkout@v4
78-
- uses: pnpm/action-setup@v4
79-
with:
80-
version: 9
81-
- uses: actions/setup-node@v4
67+
- uses: ./.github/actions/setup-env
8268
with:
8369
node-version: ${{ matrix.node }}
84-
cache: "pnpm"
8570
- name: Install
8671
run: pnpm install --frozen-lockfile --prefer-offline
8772
- name: Build

.github/workflows/hardhat-core-ci.yml

+6-22
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ on:
1212
- "packages/hardhat-core/**"
1313
- "packages/hardhat-common/**"
1414
pull_request:
15-
branches:
16-
- "**"
1715
paths:
1816
- ".github/workflows/hardhat-core-ci.yml"
1917
- "config/**"
@@ -39,16 +37,11 @@ jobs:
3937
node: [18.15]
4038
os: ["macos-13", "ubuntu-latest", "windows-latest"]
4139
steps:
42-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4341

44-
- uses: pnpm/action-setup@v4
45-
with:
46-
version: 9
47-
- name: Install Node
48-
uses: actions/setup-node@v4
42+
- uses: ./.github/actions/setup-env
4943
with:
5044
node-version: ${{ matrix.node }}
51-
cache: pnpm
5245

5346
- name: Install package
5447
run: pnpm install --frozen-lockfile --prefer-offline
@@ -81,22 +74,17 @@ jobs:
8174
node: [18.15]
8275
os: ["macos-13", "ubuntu-latest", "windows-latest"]
8376
steps:
84-
- uses: actions/checkout@v3
77+
- uses: actions/checkout@v4
8578

86-
- uses: pnpm/action-setup@v4
87-
with:
88-
version: 9
89-
- name: Install Node
90-
uses: actions/setup-node@v4
79+
- uses: ./.github/actions/setup-env
9180
with:
9281
node-version: ${{ matrix.node }}
93-
cache: pnpm
9482

9583
- name: Install package
9684
run: pnpm install --frozen-lockfile --prefer-offline
9785

9886
- name: Cache EDR RPC cache
99-
uses: actions/cache@v2
87+
uses: actions/cache@v4
10088
with:
10189
path: |
10290
packages/hardhat-core/test/internal/hardhat-network/edr-cache
@@ -123,13 +111,9 @@ jobs:
123111
node: [18, 20]
124112
steps:
125113
- uses: actions/checkout@v4
126-
- uses: pnpm/action-setup@v4
127-
with:
128-
version: 9
129-
- uses: actions/setup-node@v4
114+
- uses: ./.github/actions/setup-env
130115
with:
131116
node-version: ${{ matrix.node }}
132-
cache: pnpm
133117
- name: Install
134118
run: pnpm install --frozen-lockfile --prefer-offline
135119
- name: Install @types/node

0 commit comments

Comments
 (0)