Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into galargh/github-action…
Browse files Browse the repository at this point in the history
…s-lint
  • Loading branch information
galargh committed Aug 2, 2024
2 parents 38bb49e + 8c779d8 commit a452682
Show file tree
Hide file tree
Showing 37 changed files with 264 additions and 458 deletions.
43 changes: 43 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Setup env
description: Sets up node and pnpm

inputs:
pnpm-version:
description: Version of pnpm to install
required: false
default: "9"
node-version:
description: Version of node to install
required: false
default: "18"
cache-save:
description: Whether to save the pnpm cache
required: false
default: "false"
outputs:
cache-hit:
description: Whether the cache was restored
value: ${{ steps.setup-node.outputs.cache-hit || steps.cache-restore.outputs.cache-hit }}

runs:
using: composite
steps:
- uses: pnpm/action-setup@v4
with:
version: ${{ inputs.pnpm-version }}
- uses: actions/setup-node@v4
id: setup-node
with:
node-version: ${{ inputs.node-version }}
cache: ${{ inputs.cache-save == 'true' && 'pnpm' || '' }}
cache-dependency-path: "**/pnpm-lock.yaml"
- id: pnpm
if: inputs.cache-save == 'false'
run: pnpm store path --silent | xargs -I {} -0 echo "path={}" | tee -a $GITHUB_OUTPUT
shell: bash
- uses: actions/cache/restore@v4
id: cache-restore
if: inputs.cache-save == 'false'
with:
path: ${{ steps.pnpm.outputs.path }}
key: node-cache-${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
10 changes: 2 additions & 8 deletions .github/workflows/LATEST_DEPENDENCY_VERSIONS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ jobs:
runs-on: ${{ matrix.system }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
- uses: ./.github/actions/setup-env
- name: Delete pnpm-lock.yaml
run: "rm pnpm-lock.yaml"
- name: Install
Expand All @@ -34,7 +28,7 @@ jobs:
run: pnpm test || (echo "===== Retry =====" && pnpm test)
- name: Notify failures
if: failure()
uses: slackapi/slack-github-action@v1.18.0
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
with:
payload: |
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/add-issue-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
add-to-project:
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.4.0
- uses: actions/add-to-project@244f685bbc3b7adfa8466e08b698b5577571133e # v1.0.2
with:
project-url: https://github.com/orgs/NomicFoundation/projects/4
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/add-label-to-new-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
const issue = await github.rest.issues.get({
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/autoassign-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
permissions:
issues: write
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
// each user has a chance of (p - (previousP ?? 0)) to be assigned
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/autoassign-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
const externalPrTriager = "kanej";
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Cache

on:
push:
branches:
- main
- pre-release-testing-branch
- changeset-release/main
- v-next
paths:
- ".github/workflows/cache.yml"
- "**/pnpm-lock.yaml"
pull_request:
paths:
- ".github/workflows/cache.yml"
- "**/pnpm-lock.yaml"
workflow_dispatch:

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
cache:
name: Cache
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- id: env
uses: ./.github/actions/setup-env
with:
cache-save: true
- name: Install
if: steps.env.outputs.cache-hit != 'true'
run: |
for lockfile in $(find "$(pwd)" -name pnpm-lock.yaml); do
pushd "$(dirname "$lockfile")"
pnpm install --frozen-lockfile --prefer-offline
popd
done
2 changes: 1 addition & 1 deletion .github/workflows/check-changeset-added.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# don't run this check in the changesets PR
if: github.head_ref != 'changeset-release/main'
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
const pullNumber = context.issue.number;
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/check-docs-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ name: Check Docs Site
on:
push:
branches:
- "**"
- main
paths:
- ".github/workflows/check-docs-site.yml"
- "docs/**"
- "packages/**"
pull_request:
paths:
- ".github/workflows/check-docs-site.yml"
- "docs/**"
- "packages/**"
workflow_dispatch:

concurrency:
Expand All @@ -16,13 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
- uses: ./.github/actions/setup-env
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Install Docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Close stale issues
uses: actions/stale@v8
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
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."
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: E2E tests
on:
push:
branches:
- "main"
- main
pull_request:
branches:
- "main"
- main

jobs:
run-e2e:
Expand All @@ -29,12 +29,7 @@ jobs:
IS_WINDOWS: ${{ matrix.os == 'windows-latest' }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: ./.github/actions/setup-env
- name: Run fixture-projects script
run: |
cd e2e
Expand Down
29 changes: 7 additions & 22 deletions .github/workflows/hardhat-chai-matchers-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ name: hardhat-chai-matchers CI

on:
push:
branches: [$default-branch]
branches:
- main
paths:
- ".github/workflows/hardhat-chai-matchers-ci.yml"
- "packages/hardhat-chai-matchers/**"
- "packages/hardhat-common/**"
- "config/**"
pull_request:
branches:
- "**"
paths:
- ".github/workflows/hardhat-chai-matchers-ci.yml"
- "packages/hardhat-chai-matchers/**"
- "packages/hardhat-common/**"
- "config/**"
Expand All @@ -30,13 +31,7 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
- uses: ./.github/actions/setup-env
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
Expand All @@ -51,13 +46,7 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
- uses: ./.github/actions/setup-env
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
Expand All @@ -75,13 +64,9 @@ jobs:
node: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
- uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node }}
cache: "pnpm"
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
Expand Down
28 changes: 6 additions & 22 deletions .github/workflows/hardhat-core-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ on:
- "packages/hardhat-core/**"
- "packages/hardhat-common/**"
pull_request:
branches:
- "**"
paths:
- ".github/workflows/hardhat-core-ci.yml"
- "config/**"
Expand All @@ -39,16 +37,11 @@ jobs:
node: [18.15]
os: ["macos-13", "ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node
uses: actions/setup-node@v4
- uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Install package
run: pnpm install --frozen-lockfile --prefer-offline
Expand Down Expand Up @@ -81,22 +74,17 @@ jobs:
node: [18.15]
os: ["macos-13", "ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node
uses: actions/setup-node@v4
- uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node }}
cache: pnpm

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

- name: Cache EDR RPC cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
packages/hardhat-core/test/internal/hardhat-network/edr-cache
Expand All @@ -123,13 +111,9 @@ jobs:
node: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
- uses: ./.github/actions/setup-env
with:
node-version: ${{ matrix.node }}
cache: pnpm
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
- name: Install @types/node
Expand Down
Loading

0 comments on commit a452682

Please sign in to comment.