From e27c940bd684a09847d955f0942ca0d3264e4b50 Mon Sep 17 00:00:00 2001 From: galargh Date: Thu, 30 May 2024 10:55:54 +0100 Subject: [PATCH 1/9] Include the workflow files in the paths trigger filters --- .github/workflows/hardhat-chai-matchers-ci.yml | 2 ++ .github/workflows/hardhat-ethers-ci.yml | 2 ++ .github/workflows/hardhat-foundry-ci.yml | 2 ++ .github/workflows/hardhat-ledger-ci.yml | 2 ++ .github/workflows/hardhat-network-helpers-ci.yml | 2 ++ .github/workflows/hardhat-shorthand-ci.yml | 2 ++ .github/workflows/hardhat-solhint-ci.yml | 2 ++ .github/workflows/hardhat-solpp-ci.yml | 2 ++ .github/workflows/hardhat-toolbox-ci.yml | 2 ++ .github/workflows/hardhat-truffle4-ci.yml | 2 ++ .github/workflows/hardhat-truffle5-ci.yml | 2 ++ .github/workflows/hardhat-verify-ci.yml | 2 ++ .github/workflows/hardhat-viem-ci.yml | 2 ++ .github/workflows/hardhat-vyper-ci.yml | 2 ++ .github/workflows/hardhat-web3-ci.yml | 2 ++ .github/workflows/hardhat-web3-legacy-ci.yml | 2 ++ .github/workflows/hardhat-web3-v4-ci.yml | 2 ++ 17 files changed, 34 insertions(+) diff --git a/.github/workflows/hardhat-chai-matchers-ci.yml b/.github/workflows/hardhat-chai-matchers-ci.yml index bfaebd407d..200af4925d 100644 --- a/.github/workflows/hardhat-chai-matchers-ci.yml +++ b/.github/workflows/hardhat-chai-matchers-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-chai-matchers-ci.yml" - "packages/hardhat-chai-matchers/**" - "packages/hardhat-common/**" - "config/**" @@ -11,6 +12,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-chai-matchers-ci.yml" - "packages/hardhat-chai-matchers/**" - "packages/hardhat-common/**" - "config/**" diff --git a/.github/workflows/hardhat-ethers-ci.yml b/.github/workflows/hardhat-ethers-ci.yml index ecbd7e8a5f..d8b2537309 100644 --- a/.github/workflows/hardhat-ethers-ci.yml +++ b/.github/workflows/hardhat-ethers-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-ethers-ci.yml" - "packages/hardhat-ethers/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-ethers-ci.yml" - "packages/hardhat-ethers/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-foundry-ci.yml b/.github/workflows/hardhat-foundry-ci.yml index 7aea2b0b73..9b551f475d 100644 --- a/.github/workflows/hardhat-foundry-ci.yml +++ b/.github/workflows/hardhat-foundry-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-foundry-ci.yml" - "packages/hardhat-foundry/**" - "packages/hardhat-common/**" - "config/**" @@ -11,6 +12,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-foundry-ci.yml" - "packages/hardhat-foundry/**" - "packages/hardhat-common/**" - "config/**" diff --git a/.github/workflows/hardhat-ledger-ci.yml b/.github/workflows/hardhat-ledger-ci.yml index 25f6818975..f4e27f0d06 100644 --- a/.github/workflows/hardhat-ledger-ci.yml +++ b/.github/workflows/hardhat-ledger-ci.yml @@ -5,6 +5,7 @@ on: branches: - main paths: + - ".github/workflows/hardhat-ledger-ci.yml" - "packages/hardhat-ledger/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -13,6 +14,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-ledger-ci.yml" - "packages/hardhat-ledger/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-network-helpers-ci.yml b/.github/workflows/hardhat-network-helpers-ci.yml index cfe3ebdc64..07db0e9989 100644 --- a/.github/workflows/hardhat-network-helpers-ci.yml +++ b/.github/workflows/hardhat-network-helpers-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-network-helpers-ci.yml" - "packages/hardhat-core/**" - "packages/hardhat-network-helpers/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-network-helpers-ci.yml" - "packages/hardhat-core/**" - "packages/hardhat-network-helpers/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-shorthand-ci.yml b/.github/workflows/hardhat-shorthand-ci.yml index 1e1d87721b..db3949adc7 100644 --- a/.github/workflows/hardhat-shorthand-ci.yml +++ b/.github/workflows/hardhat-shorthand-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-shorthand-ci.yml" - "packages/hardhat-shorthand/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-shorthand-ci.yml" - "packages/hardhat-shorthand/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-solhint-ci.yml b/.github/workflows/hardhat-solhint-ci.yml index 0cbc758bcf..f9bbebdcab 100644 --- a/.github/workflows/hardhat-solhint-ci.yml +++ b/.github/workflows/hardhat-solhint-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-solhint-ci.yml" - "packages/hardhat-solhint/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-solhint-ci.yml" - "packages/hardhat-solhint/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-solpp-ci.yml b/.github/workflows/hardhat-solpp-ci.yml index 410d232287..21fe87e3fe 100644 --- a/.github/workflows/hardhat-solpp-ci.yml +++ b/.github/workflows/hardhat-solpp-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-solpp-ci.yml" - "packages/hardhat-solpp/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-solpp-ci.yml" - "packages/hardhat-solpp/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-toolbox-ci.yml b/.github/workflows/hardhat-toolbox-ci.yml index 2da121940d..5ce81a7922 100644 --- a/.github/workflows/hardhat-toolbox-ci.yml +++ b/.github/workflows/hardhat-toolbox-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-toolbox-ci.yml" - "packages/hardhat-toolbox/**" - "packages/hardhat-core/**" - "packages/hardhat-chai-matchers/**" @@ -16,6 +17,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-toolbox-ci.yml" - "packages/hardhat-toolbox/**" - "packages/hardhat-core/**" - "packages/hardhat-chai-matchers/**" diff --git a/.github/workflows/hardhat-truffle4-ci.yml b/.github/workflows/hardhat-truffle4-ci.yml index a96ea021d1..ba42d82a97 100644 --- a/.github/workflows/hardhat-truffle4-ci.yml +++ b/.github/workflows/hardhat-truffle4-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-truffle4-ci.yml" - "packages/hardhat-truffle4/**" - "packages/hardhat-web3-legacy/**" - "packages/hardhat-core/**" @@ -13,6 +14,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-truffle4-ci.yml" - "packages/hardhat-truffle4/**" - "packages/hardhat-web3-legacy/**" - "packages/hardhat-core/**" diff --git a/.github/workflows/hardhat-truffle5-ci.yml b/.github/workflows/hardhat-truffle5-ci.yml index 9f348924cb..1ac1ffa5cd 100644 --- a/.github/workflows/hardhat-truffle5-ci.yml +++ b/.github/workflows/hardhat-truffle5-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-truffle5-ci.yml" - "packages/hardhat-truffle5/**" - "packages/hardhat-web3/**" - "packages/hardhat-core/**" @@ -13,6 +14,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-truffle5-ci.yml" - "packages/hardhat-truffle5/**" - "packages/hardhat-web3/**" - "packages/hardhat-core/**" diff --git a/.github/workflows/hardhat-verify-ci.yml b/.github/workflows/hardhat-verify-ci.yml index 8d84224280..e7ae600fd7 100644 --- a/.github/workflows/hardhat-verify-ci.yml +++ b/.github/workflows/hardhat-verify-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-verify-ci.yml" - "packages/hardhat-verify/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-verify-ci.yml" - "packages/hardhat-verify/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-viem-ci.yml b/.github/workflows/hardhat-viem-ci.yml index 5647f884fc..ce4ec77344 100644 --- a/.github/workflows/hardhat-viem-ci.yml +++ b/.github/workflows/hardhat-viem-ci.yml @@ -4,6 +4,7 @@ on: push: branches: main paths: + - ".github/workflows/hardhat-viem-ci.yml" - "packages/hardhat-viem/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-viem-ci.yml" - "packages/hardhat-viem/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-vyper-ci.yml b/.github/workflows/hardhat-vyper-ci.yml index 4695c4acc7..d1aa4fd35f 100644 --- a/.github/workflows/hardhat-vyper-ci.yml +++ b/.github/workflows/hardhat-vyper-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-vyper-ci.yml" - "packages/hardhat-vyper/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-vyper-ci.yml" - "packages/hardhat-vyper/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-web3-ci.yml b/.github/workflows/hardhat-web3-ci.yml index e5cdae57d0..5c18e87cc1 100644 --- a/.github/workflows/hardhat-web3-ci.yml +++ b/.github/workflows/hardhat-web3-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-web3-ci.yml" - "packages/hardhat-web3/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-web3-ci.yml" - "packages/hardhat-web3/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-web3-legacy-ci.yml b/.github/workflows/hardhat-web3-legacy-ci.yml index 0892d3c31f..b872ea62c1 100644 --- a/.github/workflows/hardhat-web3-legacy-ci.yml +++ b/.github/workflows/hardhat-web3-legacy-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-web3-legacy-ci.yml" - "packages/hardhat-web3-legacy/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**/*" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-web3-legacy-ci.yml" - "packages/hardhat-web3-legacy/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" diff --git a/.github/workflows/hardhat-web3-v4-ci.yml b/.github/workflows/hardhat-web3-v4-ci.yml index a47b2d8996..6f2a70986e 100644 --- a/.github/workflows/hardhat-web3-v4-ci.yml +++ b/.github/workflows/hardhat-web3-v4-ci.yml @@ -4,6 +4,7 @@ on: push: branches: [$default-branch] paths: + - ".github/workflows/hardhat-web3-v4-ci.yml" - "packages/hardhat-web3-v4/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" @@ -12,6 +13,7 @@ on: branches: - "**" paths: + - ".github/workflows/hardhat-web3-v4-ci.yml" - "packages/hardhat-web3-v4/**" - "packages/hardhat-core/**" - "packages/hardhat-common/**" From af96f4d27eae426cda8a4853dc9f6c86efa8cf89 Mon Sep 17 00:00:00 2001 From: galargh Date: Thu, 30 May 2024 10:59:10 +0100 Subject: [PATCH 2/9] Do not use template syntax in the branches trigger filters --- .github/workflows/comment-on-linter-error.yml | 2 +- .github/workflows/hardhat-chai-matchers-ci.yml | 3 ++- .github/workflows/hardhat-ethers-ci.yml | 3 ++- .github/workflows/hardhat-foundry-ci.yml | 3 ++- .github/workflows/hardhat-network-helpers-ci.yml | 3 ++- .github/workflows/hardhat-shorthand-ci.yml | 3 ++- .github/workflows/hardhat-solhint-ci.yml | 3 ++- .github/workflows/hardhat-solpp-ci.yml | 3 ++- .github/workflows/hardhat-toolbox-ci.yml | 3 ++- .github/workflows/hardhat-truffle4-ci.yml | 3 ++- .github/workflows/hardhat-truffle5-ci.yml | 3 ++- .github/workflows/hardhat-verify-ci.yml | 3 ++- .github/workflows/hardhat-viem-ci.yml | 3 ++- .github/workflows/hardhat-vyper-ci.yml | 3 ++- .github/workflows/hardhat-web3-ci.yml | 3 ++- .github/workflows/hardhat-web3-legacy-ci.yml | 3 ++- .github/workflows/hardhat-web3-v4-ci.yml | 3 ++- .github/workflows/lint.yml | 3 ++- 18 files changed, 35 insertions(+), 18 deletions(-) diff --git a/.github/workflows/comment-on-linter-error.yml b/.github/workflows/comment-on-linter-error.yml index a1d4c21456..0f83bff3ae 100644 --- a/.github/workflows/comment-on-linter-error.yml +++ b/.github/workflows/comment-on-linter-error.yml @@ -5,7 +5,7 @@ on: types: - opened branches: - - $default-branch + - main concurrency: group: ${{github.workflow}}-${{github.ref}} diff --git a/.github/workflows/hardhat-chai-matchers-ci.yml b/.github/workflows/hardhat-chai-matchers-ci.yml index 200af4925d..1606954126 100644 --- a/.github/workflows/hardhat-chai-matchers-ci.yml +++ b/.github/workflows/hardhat-chai-matchers-ci.yml @@ -2,7 +2,8 @@ name: hardhat-chai-matchers CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-chai-matchers-ci.yml" - "packages/hardhat-chai-matchers/**" diff --git a/.github/workflows/hardhat-ethers-ci.yml b/.github/workflows/hardhat-ethers-ci.yml index d8b2537309..fb1416c1c1 100644 --- a/.github/workflows/hardhat-ethers-ci.yml +++ b/.github/workflows/hardhat-ethers-ci.yml @@ -2,7 +2,8 @@ name: hardhat-ethers CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-ethers-ci.yml" - "packages/hardhat-ethers/**" diff --git a/.github/workflows/hardhat-foundry-ci.yml b/.github/workflows/hardhat-foundry-ci.yml index 9b551f475d..6151a40fa4 100644 --- a/.github/workflows/hardhat-foundry-ci.yml +++ b/.github/workflows/hardhat-foundry-ci.yml @@ -2,7 +2,8 @@ name: hardhat-foundry CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-foundry-ci.yml" - "packages/hardhat-foundry/**" diff --git a/.github/workflows/hardhat-network-helpers-ci.yml b/.github/workflows/hardhat-network-helpers-ci.yml index 07db0e9989..f51960a08c 100644 --- a/.github/workflows/hardhat-network-helpers-ci.yml +++ b/.github/workflows/hardhat-network-helpers-ci.yml @@ -2,7 +2,8 @@ name: hardhat-network-helpers CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-network-helpers-ci.yml" - "packages/hardhat-core/**" diff --git a/.github/workflows/hardhat-shorthand-ci.yml b/.github/workflows/hardhat-shorthand-ci.yml index db3949adc7..c911d46b87 100644 --- a/.github/workflows/hardhat-shorthand-ci.yml +++ b/.github/workflows/hardhat-shorthand-ci.yml @@ -2,7 +2,8 @@ name: hardhat-shorthand CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-shorthand-ci.yml" - "packages/hardhat-shorthand/**" diff --git a/.github/workflows/hardhat-solhint-ci.yml b/.github/workflows/hardhat-solhint-ci.yml index f9bbebdcab..931d104990 100644 --- a/.github/workflows/hardhat-solhint-ci.yml +++ b/.github/workflows/hardhat-solhint-ci.yml @@ -2,7 +2,8 @@ name: hardhat-solhint CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-solhint-ci.yml" - "packages/hardhat-solhint/**" diff --git a/.github/workflows/hardhat-solpp-ci.yml b/.github/workflows/hardhat-solpp-ci.yml index 21fe87e3fe..ec07fcc6bd 100644 --- a/.github/workflows/hardhat-solpp-ci.yml +++ b/.github/workflows/hardhat-solpp-ci.yml @@ -2,7 +2,8 @@ name: hardhat-solpp CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-solpp-ci.yml" - "packages/hardhat-solpp/**" diff --git a/.github/workflows/hardhat-toolbox-ci.yml b/.github/workflows/hardhat-toolbox-ci.yml index 5ce81a7922..bf17589ecf 100644 --- a/.github/workflows/hardhat-toolbox-ci.yml +++ b/.github/workflows/hardhat-toolbox-ci.yml @@ -2,7 +2,8 @@ name: hardhat-toolbox CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-toolbox-ci.yml" - "packages/hardhat-toolbox/**" diff --git a/.github/workflows/hardhat-truffle4-ci.yml b/.github/workflows/hardhat-truffle4-ci.yml index ba42d82a97..154d4e2514 100644 --- a/.github/workflows/hardhat-truffle4-ci.yml +++ b/.github/workflows/hardhat-truffle4-ci.yml @@ -2,7 +2,8 @@ name: hardhat-truffle4 CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-truffle4-ci.yml" - "packages/hardhat-truffle4/**" diff --git a/.github/workflows/hardhat-truffle5-ci.yml b/.github/workflows/hardhat-truffle5-ci.yml index 1ac1ffa5cd..8c49bce4d1 100644 --- a/.github/workflows/hardhat-truffle5-ci.yml +++ b/.github/workflows/hardhat-truffle5-ci.yml @@ -2,7 +2,8 @@ name: hardhat-truffle5 CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-truffle5-ci.yml" - "packages/hardhat-truffle5/**" diff --git a/.github/workflows/hardhat-verify-ci.yml b/.github/workflows/hardhat-verify-ci.yml index e7ae600fd7..5b47209570 100644 --- a/.github/workflows/hardhat-verify-ci.yml +++ b/.github/workflows/hardhat-verify-ci.yml @@ -2,7 +2,8 @@ name: hardhat-verify CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-verify-ci.yml" - "packages/hardhat-verify/**" diff --git a/.github/workflows/hardhat-viem-ci.yml b/.github/workflows/hardhat-viem-ci.yml index ce4ec77344..618a248961 100644 --- a/.github/workflows/hardhat-viem-ci.yml +++ b/.github/workflows/hardhat-viem-ci.yml @@ -2,7 +2,8 @@ name: hardhat-viem CI on: push: - branches: main + branches: + - main paths: - ".github/workflows/hardhat-viem-ci.yml" - "packages/hardhat-viem/**" diff --git a/.github/workflows/hardhat-vyper-ci.yml b/.github/workflows/hardhat-vyper-ci.yml index d1aa4fd35f..81e589397f 100644 --- a/.github/workflows/hardhat-vyper-ci.yml +++ b/.github/workflows/hardhat-vyper-ci.yml @@ -2,7 +2,8 @@ name: hardhat-vyper CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-vyper-ci.yml" - "packages/hardhat-vyper/**" diff --git a/.github/workflows/hardhat-web3-ci.yml b/.github/workflows/hardhat-web3-ci.yml index 5c18e87cc1..fa56aa7eab 100644 --- a/.github/workflows/hardhat-web3-ci.yml +++ b/.github/workflows/hardhat-web3-ci.yml @@ -2,7 +2,8 @@ name: hardhat-web3 CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-web3-ci.yml" - "packages/hardhat-web3/**" diff --git a/.github/workflows/hardhat-web3-legacy-ci.yml b/.github/workflows/hardhat-web3-legacy-ci.yml index b872ea62c1..ed50c82a7c 100644 --- a/.github/workflows/hardhat-web3-legacy-ci.yml +++ b/.github/workflows/hardhat-web3-legacy-ci.yml @@ -2,7 +2,8 @@ name: hardhat-web3-legacy CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-web3-legacy-ci.yml" - "packages/hardhat-web3-legacy/**" diff --git a/.github/workflows/hardhat-web3-v4-ci.yml b/.github/workflows/hardhat-web3-v4-ci.yml index 6f2a70986e..98cb751f6d 100644 --- a/.github/workflows/hardhat-web3-v4-ci.yml +++ b/.github/workflows/hardhat-web3-v4-ci.yml @@ -2,7 +2,8 @@ name: hardhat-web3-v4 CI on: push: - branches: [$default-branch] + branches: + - main paths: - ".github/workflows/hardhat-web3-v4-ci.yml" - "packages/hardhat-web3-v4/**" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 19877ba53b..da9d07da31 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,7 +2,8 @@ name: Lint on: push: - branches: [$default-branch] + branches: + - main pull_request: branches: - "**" From c56528af08e7ab2d5328bc76e43b573d0ccaa901 Mon Sep 17 00:00:00 2001 From: galargh Date: Thu, 30 May 2024 11:15:56 +0100 Subject: [PATCH 3/9] Parallelize the Lint workflow --- .github/workflows/lint.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index da9d07da31..1bbe2d44f6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,6 +17,13 @@ jobs: lint: name: Lint runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + working-directory: ["", "docs"] + defaults: + run: + working-directory: ${{ matrix.working-directory || github.workspace }} steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2 @@ -27,19 +34,16 @@ jobs: node-version: 18 cache: "pnpm" cache-dependency-path: | - pnpm-lock.yaml - docs/pnpm-lock.yaml + ${{ matrix.working-directory || '.' }}/pnpm-lock.yaml - name: Install run: pnpm install --frozen-lockfile --prefer-offline + # Linting under the root directory requires build because some packages + # depend on local eslint-plugin-* packages - name: Build + if: matrix.working-directory == '' run: pnpm build - - name: lint + - name: Lint run: pnpm lint - name: Check dependency versions + if: matrix.working-directory == '' run: node scripts/check-dependencies.js - - name: Install website - working-directory: docs/ - run: pnpm install --frozen-lockfile --prefer-offline - - name: Lint website - working-directory: docs/ - run: pnpm lint From ac06514b1f094d25880a86a4358eafad50bc2ec2 Mon Sep 17 00:00:00 2001 From: galargh Date: Thu, 30 May 2024 12:44:34 +0100 Subject: [PATCH 4/9] Do not duplicate linting work --- .github/workflows/check-docs-site.yml | 17 +++---- .github/workflows/comment-on-linter-error.yml | 47 +++++++------------ .github/workflows/lint.yml | 8 ++++ 3 files changed, 33 insertions(+), 39 deletions(-) diff --git a/.github/workflows/check-docs-site.yml b/.github/workflows/check-docs-site.yml index ba2933b459..a7d6efe429 100644 --- a/.github/workflows/check-docs-site.yml +++ b/.github/workflows/check-docs-site.yml @@ -11,9 +11,12 @@ concurrency: cancel-in-progress: true jobs: - lint: - name: Lint + build: + name: Build runs-on: ubuntu-latest + defaults: + run: + working-directory: docs steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2 @@ -23,11 +26,9 @@ jobs: with: node-version: 18 cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline + cache-dependency-path: | + docs/pnpm-lock.yaml - name: Install Docs - run: cd docs && pnpm install --frozen-lockfile --prefer-offline - - name: lint - run: cd docs && pnpm lint + run: pnpm install --frozen-lockfile --prefer-offline - name: Build - run: cd docs && pnpm build + run: pnpm build diff --git a/.github/workflows/comment-on-linter-error.yml b/.github/workflows/comment-on-linter-error.yml index 0f83bff3ae..f25a502815 100644 --- a/.github/workflows/comment-on-linter-error.yml +++ b/.github/workflows/comment-on-linter-error.yml @@ -1,53 +1,38 @@ name: Comment on lint failure on: - pull_request_target: + workflow_run: + workflows: + - Lint types: - - opened - branches: - - main + - completed concurrency: - group: ${{github.workflow}}-${{github.ref}} + group: "${{github.workflow}}-${{github.event.workflow_run.event}}-${{github.event.workflow_run.head_repository.full_name}}:${{github.event.workflow_run.head_branch}}" cancel-in-progress: true jobs: comment_on_lint_failure: name: Comment on lint failure runs-on: ubuntu-latest + if: | + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'failure' steps: - - name: Checkout repo - uses: actions/checkout@v4 + - uses: ipdxco/workflow-run-context@492ea3967eb2ca7ed76b7888b42fa7649addd975 # v1.1.1 + name: Get workflow run context + id: context with: - ref: "refs/pull/${{ github.event.number }}/merge" - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: lint - run: pnpm lint - - name: Check dependency versions - run: node scripts/check-dependencies.js - - name: Install website - working-directory: docs/ - run: pnpm install --frozen-lockfile --prefer-offline - - name: Lint website - working-directory: docs/ - run: pnpm lint + artifacts-url: ${{ github.event.workflow_run.artifacts_url }} + artifact-names: event - uses: actions/github-script@v6 name: Comment on failure - if: ${{ failure() }} + env: + NUMBER: ${{ fromJSON(steps.context.outputs.artifacts)['event'].files['event.json'].number }} with: script: | github.rest.issues.createComment({ - issue_number: context.issue.number, + issue_number: process.env.NUMBER, owner: context.repo.owner, repo: context.repo.repo, body: "Thanks for submitting this PR!\n\nUnfortunately, it has some linter errors, so we can't merge it yet. Can you please fix them?\n\nRunning pnpm lint:fix in the root of the repository may fix them automatically." diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1bbe2d44f6..f3bd6a86e1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -47,3 +47,11 @@ jobs: - name: Check dependency versions if: matrix.working-directory == '' run: node scripts/check-dependencies.js + save_event: + name: Save event + runs-on: ubuntu-latest + steps: + - uses: actions/upload-artifact@v4 + with: + name: event + path: ${{ github.event_path }} From 8de529a343ee1fa80acac7a0d75ff02b857ca67a Mon Sep 17 00:00:00 2001 From: galargh Date: Thu, 30 May 2024 15:11:48 +0100 Subject: [PATCH 5/9] Use matrix strategy to test packages --- .../workflows/hardhat-chai-matchers-ci.yml | 95 ---------- .github/workflows/hardhat-ci.yml | 166 ++++++++++++++++++ .github/workflows/hardhat-ethers-ci.yml | 91 ---------- .github/workflows/hardhat-foundry-ci.yml | 95 ---------- .github/workflows/hardhat-ledger-ci.yml | 91 ---------- .../workflows/hardhat-network-helpers-ci.yml | 97 ---------- .github/workflows/hardhat-shorthand-ci.yml | 91 ---------- .github/workflows/hardhat-solhint-ci.yml | 91 ---------- .github/workflows/hardhat-solpp-ci.yml | 72 -------- .github/workflows/hardhat-toolbox-ci.yml | 99 ----------- .github/workflows/hardhat-truffle4-ci.yml | 93 ---------- .github/workflows/hardhat-truffle5-ci.yml | 93 ---------- .github/workflows/hardhat-verify-ci.yml | 91 ---------- .github/workflows/hardhat-viem-ci.yml | 91 ---------- .github/workflows/hardhat-vyper-ci.yml | 53 ------ .github/workflows/hardhat-web3-ci.yml | 91 ---------- .github/workflows/hardhat-web3-legacy-ci.yml | 91 ---------- .github/workflows/hardhat-web3-v4-ci.yml | 91 ---------- 18 files changed, 166 insertions(+), 1516 deletions(-) delete mode 100644 .github/workflows/hardhat-chai-matchers-ci.yml create mode 100644 .github/workflows/hardhat-ci.yml delete mode 100644 .github/workflows/hardhat-ethers-ci.yml delete mode 100644 .github/workflows/hardhat-foundry-ci.yml delete mode 100644 .github/workflows/hardhat-ledger-ci.yml delete mode 100644 .github/workflows/hardhat-network-helpers-ci.yml delete mode 100644 .github/workflows/hardhat-shorthand-ci.yml delete mode 100644 .github/workflows/hardhat-solhint-ci.yml delete mode 100644 .github/workflows/hardhat-solpp-ci.yml delete mode 100644 .github/workflows/hardhat-toolbox-ci.yml delete mode 100644 .github/workflows/hardhat-truffle4-ci.yml delete mode 100644 .github/workflows/hardhat-truffle5-ci.yml delete mode 100644 .github/workflows/hardhat-verify-ci.yml delete mode 100644 .github/workflows/hardhat-viem-ci.yml delete mode 100644 .github/workflows/hardhat-vyper-ci.yml delete mode 100644 .github/workflows/hardhat-web3-ci.yml delete mode 100644 .github/workflows/hardhat-web3-legacy-ci.yml delete mode 100644 .github/workflows/hardhat-web3-v4-ci.yml diff --git a/.github/workflows/hardhat-chai-matchers-ci.yml b/.github/workflows/hardhat-chai-matchers-ci.yml deleted file mode 100644 index 1606954126..0000000000 --- a/.github/workflows/hardhat-chai-matchers-ci.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: hardhat-chai-matchers CI - -on: - push: - 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/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-chai-matchers - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-chai-matchers on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test:ci - - test_on_macos: - name: Test hardhat-chai-matchers on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test:ci - - test_on_linux: - name: Test hardhat-chai-matchers on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test:ci diff --git a/.github/workflows/hardhat-ci.yml b/.github/workflows/hardhat-ci.yml new file mode 100644 index 0000000000..7def1bf19c --- /dev/null +++ b/.github/workflows/hardhat-ci.yml @@ -0,0 +1,166 @@ +name: hardhat CI + +on: + push: + branches: + - main + pull_request: + branches: + - "**" + workflow_dispatch: + +concurrency: + group: ${{github.workflow}}-${{github.ref}} + cancel-in-progress: true + +jobs: + packages: + name: Find packages to test + runs-on: ubuntu-latest + outputs: + packages: ${{ steps.packages.outputs.result }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Fetch files modified in push event + if: github.event_name == 'push' + env: + BEFORE: ${{ github.event.before }} + AFTER: ${{ github.event.after }} + run: git diff --name-only $BEFORE $AFTER | tee files.txt + - name: Parse pnpm lock file + run: yq -p yaml -o json pnpm-lock.yaml | tee pnpm-lock.json + - uses: actions/github-script@v7 + name: Find packages to test + id: packages + env: + EXCLUDED_PACKAGES: | + . + packages/hardhat-core + packages/common + packages/eslint-plugin-hardhat-internal-rules + packages/eslint-plugin-slow-imports + COMMON_DEPENDENCIES: | + packages/common + config + WORKFLOW_FILE: .github/workflows/hardhat-ci.yml + with: + script: | + const fs = require('fs'); + + const excludedPackages = process.env.EXCLUDED_PACKAGES.split('\n').filter(p => p); + const commonDependencies = process.env.COMMON_DEPENDENCIES.split('\n').filter(p => p); + const workflowFile = process.env.WORKFLOW_FILE; + + const event = context.eventName; + const modifiedFiles = []; + + if (event === 'pull_request') { + core.info('This is a pull request event') + const pullNumber = context.issue.number; + + core.info(`Fetching files for pull request #${pullNumber}`); + const files = await github.paginate(github.rest.pulls.listFiles, { + ...context.issue, + pull_number: pullNumber + }); + modifiedFiles.push(...files.map(file => file.filename)); + core.info(`Modified files: ${JSON.stringify(modifiedFiles)}`); + } else if (event === 'push') { + core.info('This is a push event') + core.info(`Fetching files modified between ${context.payload.before} and ${context.payload.after}`) + const files = fs.readFileSync('files.txt', 'utf8').split('\n').filter(f => f); + modifiedFiles.push(...files); + core.info(`Modified files: ${JSON.stringify(modifiedFiles)}`); + } + + core.info('Checking if workflow file was modified') + const isWorkflowFileModified = modifiedFiles.includes(workflowFile); + core.info(`Workflow file was modified: ${isWorkflowFileModified}`) + + core.info('Reading pnpm lock file') + const lock = JSON.parse(fs.readFileSync('pnpm-lock.json', 'utf8')); + const packagesToTest = []; + + core.info('Finding packages to test') + for (const [package, dependencies] of Object.entries(lock.importers)) { + core.info(`Checking package ${package}`) + + if (excludedPackages.includes(package)) { + core.info(`Package ${package} is excluded, skipping`) + continue; + } + + if (event === 'workflow_dispatch' || isWorkflowFileModified) { + core.info(`Workflow was dispatched or workflow file was modified, testing package ${package}`) + packagesToTest.push(package); + continue; + } + + core.info(`Finding internal dependencies for package ${package} (only direct; not transitive)`) + const internalDependencies = Object.values(dependencies) + .flatMap(d => Object.values(d)) + .map(d => d.version) + .filter(dependency => dependency.startsWith('link:../')) + .map(dependency => dependency.replace('link:../', 'packages/')); + core.info(`Internal dependencies for package ${package}: ${JSON.stringify(internalDependencies)}`) + + core.info(`Checking if package ${package} or its internal dependencies were modified`) + const prefixes = [ + package, + ...internalDependencies, + ...commonDependencies, + ].map(p => `${p}/`); + const isPackageModified = prefixes.some(p => modifiedFiles.some(f => f.startsWith(p))); + core.info(`Package ${package} or its internal dependencies were modified: ${isPackageModified}`) + + if (isPackageModified) { + core.info(`Package ${package} or its internal dependencies were modified, testing package ${package}`) + packagesToTest.push(package); + } + } + + core.info(`Packages to test: ${JSON.stringify(packagesToTest)}`) + + return packagesToTest.map(p => p.replace('packages/', '')); + test: + needs: [packages] + name: Test ${{ matrix.package }} on ${{ matrix.runner }} with Node ${{ matrix.node_version }} + runs-on: ${{ matrix.runner }} + if: needs.packages.outputs.packages != '[]' + strategy: + fail-fast: false + matrix: + package: ${{ fromJSON(needs.packages.outputs.packages) }} + runner: [windows-latest, macos-latest, ubuntu-latest] + node_version: [18, 20] + exclude: + - package: hardhat-vyper + runner: windows-latest + - package: hardhat-vyper + runner: macos-latest + - runner: windows-latest + node_version: 20 + - runner: macos-latest + node_version: 20 + defaults: + run: + working-directory: packages/${{ matrix.package }} + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v2 + with: + version: 9 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node_version }} + cache: pnpm + - name: Install + run: pnpm install --frozen-lockfile --prefer-offline + - name: Build + run: pnpm build + - name: Run tests + env: + FORCE_COLOR: 3 + run: pnpm ${{ matrix.package == 'hardhat-chai-matchers' && 'test:ci' || 'test' }} diff --git a/.github/workflows/hardhat-ethers-ci.yml b/.github/workflows/hardhat-ethers-ci.yml deleted file mode 100644 index fb1416c1c1..0000000000 --- a/.github/workflows/hardhat-ethers-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: hardhat-ethers CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-ethers-ci.yml" - - "packages/hardhat-ethers/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-ethers-ci.yml" - - "packages/hardhat-ethers/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-ethers - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-ethers on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-ethers on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-ethers on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-foundry-ci.yml b/.github/workflows/hardhat-foundry-ci.yml deleted file mode 100644 index 6151a40fa4..0000000000 --- a/.github/workflows/hardhat-foundry-ci.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: hardhat-foundry CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-foundry-ci.yml" - - "packages/hardhat-foundry/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-foundry-ci.yml" - - "packages/hardhat-foundry/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-foundry - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-foundry on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test - - test_on_macos: - name: Test hardhat-foundry on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test - - test_on_linux: - name: Test hardhat-foundry on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test diff --git a/.github/workflows/hardhat-ledger-ci.yml b/.github/workflows/hardhat-ledger-ci.yml deleted file mode 100644 index f4e27f0d06..0000000000 --- a/.github/workflows/hardhat-ledger-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: hardhat-ledger CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-ledger-ci.yml" - - "packages/hardhat-ledger/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-ledger-ci.yml" - - "packages/hardhat-ledger/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-ledger - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-ledger on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-ledger on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-ledger on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-network-helpers-ci.yml b/.github/workflows/hardhat-network-helpers-ci.yml deleted file mode 100644 index f51960a08c..0000000000 --- a/.github/workflows/hardhat-network-helpers-ci.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: hardhat-network-helpers CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-network-helpers-ci.yml" - - "packages/hardhat-core/**" - - "packages/hardhat-network-helpers/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-network-helpers-ci.yml" - - "packages/hardhat-core/**" - - "packages/hardhat-network-helpers/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-network-helpers - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-network-helpers on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test - - test_on_macos: - name: Test hardhat-network-helpers on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test - - test_on_linux: - name: Test hardhat-network-helpers on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - env: - FORCE_COLOR: 3 - run: pnpm test diff --git a/.github/workflows/hardhat-shorthand-ci.yml b/.github/workflows/hardhat-shorthand-ci.yml deleted file mode 100644 index c911d46b87..0000000000 --- a/.github/workflows/hardhat-shorthand-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: hardhat-shorthand CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-shorthand-ci.yml" - - "packages/hardhat-shorthand/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-shorthand-ci.yml" - - "packages/hardhat-shorthand/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-shorthand - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-shorthand on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-shorthand on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-shorthand on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-solhint-ci.yml b/.github/workflows/hardhat-solhint-ci.yml deleted file mode 100644 index 931d104990..0000000000 --- a/.github/workflows/hardhat-solhint-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: hardhat-solhint CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-solhint-ci.yml" - - "packages/hardhat-solhint/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-solhint-ci.yml" - - "packages/hardhat-solhint/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-solhint - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-solhint on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-solhint on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-solhint on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-solpp-ci.yml b/.github/workflows/hardhat-solpp-ci.yml deleted file mode 100644 index ec07fcc6bd..0000000000 --- a/.github/workflows/hardhat-solpp-ci.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: hardhat-solpp CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-solpp-ci.yml" - - "packages/hardhat-solpp/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-solpp-ci.yml" - - "packages/hardhat-solpp/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-solpp - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_macos: - name: Test hardhat-solpp on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-solpp on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-toolbox-ci.yml b/.github/workflows/hardhat-toolbox-ci.yml deleted file mode 100644 index bf17589ecf..0000000000 --- a/.github/workflows/hardhat-toolbox-ci.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: hardhat-toolbox CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-toolbox-ci.yml" - - "packages/hardhat-toolbox/**" - - "packages/hardhat-core/**" - - "packages/hardhat-chai-matchers/**" - - "packages/hardhat-network-helpers/**" - - "packages/hardhat-ethers/**" - - "packages/hardhat-verify/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-toolbox-ci.yml" - - "packages/hardhat-toolbox/**" - - "packages/hardhat-core/**" - - "packages/hardhat-chai-matchers/**" - - "packages/hardhat-network-helpers/**" - - "packages/hardhat-ethers/**" - - "packages/hardhat-verify/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-toolbox - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-toolbox on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-toolbox on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-toolbox on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-truffle4-ci.yml b/.github/workflows/hardhat-truffle4-ci.yml deleted file mode 100644 index 154d4e2514..0000000000 --- a/.github/workflows/hardhat-truffle4-ci.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: hardhat-truffle4 CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-truffle4-ci.yml" - - "packages/hardhat-truffle4/**" - - "packages/hardhat-web3-legacy/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-truffle4-ci.yml" - - "packages/hardhat-truffle4/**" - - "packages/hardhat-web3-legacy/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-truffle4 - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-truffle4 on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-truffle4 on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-truffle4 on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-truffle5-ci.yml b/.github/workflows/hardhat-truffle5-ci.yml deleted file mode 100644 index 8c49bce4d1..0000000000 --- a/.github/workflows/hardhat-truffle5-ci.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: hardhat-truffle5 CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-truffle5-ci.yml" - - "packages/hardhat-truffle5/**" - - "packages/hardhat-web3/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-truffle5-ci.yml" - - "packages/hardhat-truffle5/**" - - "packages/hardhat-web3/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-truffle5 - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-truffle5 on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-truffle5 on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-truffle5 on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-verify-ci.yml b/.github/workflows/hardhat-verify-ci.yml deleted file mode 100644 index 5b47209570..0000000000 --- a/.github/workflows/hardhat-verify-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: hardhat-verify CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-verify-ci.yml" - - "packages/hardhat-verify/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-verify-ci.yml" - - "packages/hardhat-verify/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-verify - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-verify on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-verify on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-verify on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-viem-ci.yml b/.github/workflows/hardhat-viem-ci.yml deleted file mode 100644 index 618a248961..0000000000 --- a/.github/workflows/hardhat-viem-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: hardhat-viem CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-viem-ci.yml" - - "packages/hardhat-viem/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-viem-ci.yml" - - "packages/hardhat-viem/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-viem - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-viem on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-viem on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-viem on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-vyper-ci.yml b/.github/workflows/hardhat-vyper-ci.yml deleted file mode 100644 index 81e589397f..0000000000 --- a/.github/workflows/hardhat-vyper-ci.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: hardhat-vyper CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-vyper-ci.yml" - - "packages/hardhat-vyper/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-vyper-ci.yml" - - "packages/hardhat-vyper/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-vyper - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_linux: - name: Test hardhat-vyper on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-web3-ci.yml b/.github/workflows/hardhat-web3-ci.yml deleted file mode 100644 index fa56aa7eab..0000000000 --- a/.github/workflows/hardhat-web3-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: hardhat-web3 CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-web3-ci.yml" - - "packages/hardhat-web3/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-web3-ci.yml" - - "packages/hardhat-web3/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-web3 - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-web3 on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-web3 on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-web3 on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-web3-legacy-ci.yml b/.github/workflows/hardhat-web3-legacy-ci.yml deleted file mode 100644 index ed50c82a7c..0000000000 --- a/.github/workflows/hardhat-web3-legacy-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: hardhat-web3-legacy CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-web3-legacy-ci.yml" - - "packages/hardhat-web3-legacy/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**/*" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-web3-legacy-ci.yml" - - "packages/hardhat-web3-legacy/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-web3-legacy - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-web3-legacy on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-web3-legacy on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-web3-legacy on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: "pnpm" - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test diff --git a/.github/workflows/hardhat-web3-v4-ci.yml b/.github/workflows/hardhat-web3-v4-ci.yml deleted file mode 100644 index 98cb751f6d..0000000000 --- a/.github/workflows/hardhat-web3-v4-ci.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: hardhat-web3-v4 CI - -on: - push: - branches: - - main - paths: - - ".github/workflows/hardhat-web3-v4-ci.yml" - - "packages/hardhat-web3-v4/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - pull_request: - branches: - - "**" - paths: - - ".github/workflows/hardhat-web3-v4-ci.yml" - - "packages/hardhat-web3-v4/**" - - "packages/hardhat-core/**" - - "packages/hardhat-common/**" - - "config/**" - workflow_dispatch: - -defaults: - run: - working-directory: packages/hardhat-web3-v4 - -concurrency: - group: ${{github.workflow}}-${{github.ref}} - cancel-in-progress: true - -jobs: - test_on_windows: - name: Test hardhat-web3-v4 on Windows with Node 18 - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: pnpm - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_macos: - name: Test hardhat-web3-v4 on MacOS with Node 18 - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: pnpm - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test - - test_on_linux: - name: Test hardhat-web3-v4 on Ubuntu with Node ${{ matrix.node }} - runs-on: ubuntu-latest - strategy: - matrix: - node: [18, 20] - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - cache: pnpm - - name: Install - run: pnpm install --frozen-lockfile --prefer-offline - - name: Build - run: pnpm build - - name: Run tests - run: pnpm test From 322f13c23310efa960b3f19739d51ebb5890d8e8 Mon Sep 17 00:00:00 2001 From: galargh Date: Thu, 30 May 2024 17:36:41 +0100 Subject: [PATCH 6/9] Upgrade outdated GitHub actions --- .github/workflows/LATEST_DEPENDENCY_VERSIONS.yml | 4 ++-- .github/workflows/add-issue-to-project.yml | 2 +- .github/workflows/add-label-to-new-issue.yml | 2 +- .github/workflows/autoassign-issues.yml | 2 +- .github/workflows/autoassign-prs.yml | 2 +- .github/workflows/check-changeset-added.yml | 2 +- .github/workflows/check-docs-site.yml | 2 +- .github/workflows/comment-on-linter-error.yml | 2 +- .github/workflows/e2e-tests.yml | 2 +- .github/workflows/hardhat-ci.yml | 2 +- .github/workflows/hardhat-core-ci.yml | 12 ++++++------ .../hardhat-network-tracing-all-solc-versions.yml | 4 ++-- .github/workflows/lint.yml | 2 +- .github/workflows/lock.yml | 3 ++- .github/workflows/pre-release.yml | 8 ++++---- .github/workflows/release.yml | 2 +- .github/workflows/test-slow-imports-rule.yml | 2 +- 17 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml b/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml index 6098f1a400..6e79ca61eb 100644 --- a/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml +++ b/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.system }} steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 @@ -34,7 +34,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: | { diff --git a/.github/workflows/add-issue-to-project.yml b/.github/workflows/add-issue-to-project.yml index 5ab3e0b2db..ac10331829 100644 --- a/.github/workflows/add-issue-to-project.yml +++ b/.github/workflows/add-issue-to-project.yml @@ -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@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1 with: project-url: https://github.com/orgs/NomicFoundation/projects/4 github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} diff --git a/.github/workflows/add-label-to-new-issue.yml b/.github/workflows/add-label-to-new-issue.yml index a6c6c5345d..2bd47099b5 100644 --- a/.github/workflows/add-label-to-new-issue.yml +++ b/.github/workflows/add-label-to-new-issue.yml @@ -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({ diff --git a/.github/workflows/autoassign-issues.yml b/.github/workflows/autoassign-issues.yml index efd4be5620..318b21074a 100644 --- a/.github/workflows/autoassign-issues.yml +++ b/.github/workflows/autoassign-issues.yml @@ -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 diff --git a/.github/workflows/autoassign-prs.yml b/.github/workflows/autoassign-prs.yml index df5441a02f..f98c9f4f09 100644 --- a/.github/workflows/autoassign-prs.yml +++ b/.github/workflows/autoassign-prs.yml @@ -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"; diff --git a/.github/workflows/check-changeset-added.yml b/.github/workflows/check-changeset-added.yml index 475fd48ec5..143e1adb39 100644 --- a/.github/workflows/check-changeset-added.yml +++ b/.github/workflows/check-changeset-added.yml @@ -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; diff --git a/.github/workflows/check-docs-site.yml b/.github/workflows/check-docs-site.yml index a7d6efe429..d8800c1abc 100644 --- a/.github/workflows/check-docs-site.yml +++ b/.github/workflows/check-docs-site.yml @@ -19,7 +19,7 @@ jobs: working-directory: docs steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 diff --git a/.github/workflows/comment-on-linter-error.yml b/.github/workflows/comment-on-linter-error.yml index f25a502815..6657546e7f 100644 --- a/.github/workflows/comment-on-linter-error.yml +++ b/.github/workflows/comment-on-linter-error.yml @@ -25,7 +25,7 @@ jobs: with: artifacts-url: ${{ github.event.workflow_run.artifacts_url }} artifact-names: event - - uses: actions/github-script@v6 + - uses: actions/github-script@v7 name: Comment on failure env: NUMBER: ${{ fromJSON(steps.context.outputs.artifacts)['event'].files['event.json'].number }} diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index b9b6eb3393..08f1e47d12 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -29,7 +29,7 @@ jobs: IS_WINDOWS: ${{ matrix.os == 'windows-latest' }} steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 diff --git a/.github/workflows/hardhat-ci.yml b/.github/workflows/hardhat-ci.yml index 7def1bf19c..b195ebebf6 100644 --- a/.github/workflows/hardhat-ci.yml +++ b/.github/workflows/hardhat-ci.yml @@ -149,7 +149,7 @@ jobs: working-directory: packages/${{ matrix.package }} steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 diff --git a/.github/workflows/hardhat-core-ci.yml b/.github/workflows/hardhat-core-ci.yml index f5a74560cb..627b17238a 100644 --- a/.github/workflows/hardhat-core-ci.yml +++ b/.github/workflows/hardhat-core-ci.yml @@ -39,9 +39,9 @@ jobs: node: [18.15] os: ["macos-13", "ubuntu-latest", "windows-latest"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - name: Install Node @@ -81,9 +81,9 @@ jobs: node: [18.15] os: ["macos-13", "ubuntu-latest", "windows-latest"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - name: Install Node @@ -96,7 +96,7 @@ jobs: 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 @@ -121,7 +121,7 @@ jobs: node: [18, 20] steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 diff --git a/.github/workflows/hardhat-network-tracing-all-solc-versions.yml b/.github/workflows/hardhat-network-tracing-all-solc-versions.yml index 2bc99a11e8..b5523580ff 100644 --- a/.github/workflows/hardhat-network-tracing-all-solc-versions.yml +++ b/.github/workflows/hardhat-network-tracing-all-solc-versions.yml @@ -22,7 +22,7 @@ jobs: node: [18, 20] steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 @@ -34,7 +34,7 @@ jobs: - name: Build run: pnpm build - name: Cache artifacts - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/artifacts diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f3bd6a86e1..a6640bfd86 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,7 @@ jobs: working-directory: ${{ matrix.working-directory || github.workspace }} steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 113315dfc2..1b90eae439 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -16,7 +16,8 @@ jobs: action: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@e460dfeb36e731f3aeb214be6b0c9a9d9a67eda6 + - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1 with: issue-inactive-days: "90" pr-inactive-days: "90" + process-only: "issues, prs" diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index d534a52b5f..d08e3bcfc6 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 @@ -31,7 +31,7 @@ jobs: - name: lint run: pnpm lint - name: Cache artifacts - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | packages/hardhat-core/test/internal/hardhat-network/stack-traces/test-files/artifacts @@ -52,7 +52,7 @@ jobs: working-directory: packages/hardhat-core steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 @@ -62,7 +62,7 @@ jobs: - name: Install run: pnpm install --frozen-lockfile --prefer-offline - name: Cache network requests - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | packages/hardhat-core/test/internal/hardhat-network/provider/.hardhat_node_test_cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c91ece727..8d49ad9b64 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - name: Setup pnpm - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v4 with: version: 9 diff --git a/.github/workflows/test-slow-imports-rule.yml b/.github/workflows/test-slow-imports-rule.yml index dcdddb3634..6f6d2a3847 100644 --- a/.github/workflows/test-slow-imports-rule.yml +++ b/.github/workflows/test-slow-imports-rule.yml @@ -22,7 +22,7 @@ jobs: runs-on: "ubuntu-latest" steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: version: 9 - uses: actions/setup-node@v4 From f750bb766f11e9926b181dcc13938380a3e832fc Mon Sep 17 00:00:00 2001 From: galargh Date: Fri, 31 May 2024 11:44:17 +0100 Subject: [PATCH 7/9] Save cache only in Populate cache workflow --- .github/actions/setup-env/action.yml | 60 +++++++++++++++++++ .../workflows/LATEST_DEPENDENCY_VERSIONS.yml | 8 +-- .github/workflows/check-docs-site.yml | 11 +--- .github/workflows/e2e-tests.yml | 8 +-- .github/workflows/hardhat-ci.yml | 6 +- .github/workflows/hardhat-core-ci.yml | 20 +------ ...dhat-network-tracing-all-solc-versions.yml | 6 +- .github/workflows/lint.yml | 11 +--- .github/workflows/populate-cache.yml | 37 ++++++++++++ .github/workflows/pre-release.yml | 16 +---- .github/workflows/release.yml | 9 +-- .github/workflows/test-slow-imports-rule.yml | 8 +-- 12 files changed, 116 insertions(+), 84 deletions(-) create mode 100644 .github/actions/setup-env/action.yml create mode 100644 .github/workflows/populate-cache.yml diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml new file mode 100644 index 0000000000..27b621aa61 --- /dev/null +++ b/.github/actions/setup-env/action.yml @@ -0,0 +1,60 @@ +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-restore: + description: Whether to restore the pnpm cache + required: false + default: "true" + cache-save: + description: Whether to save the pnpm cache + required: false + default: "false" + pnpm-lockfile: + description: Path to the pnpm lockfile + required: false + default: "pnpm-lock.yaml" + package-json: + description: Path to the package.json file + required: false + default: "package.json" +outputs: + cache-hit: + description: Whether the cache was restored + value: ${{ steps.node.outputs.cache-hit }} + +runs: + using: composite + steps: + - if: inputs.cache-save == 'true' && inputs.cache-restore == 'false' + run: | + echo "::error::Saving the cache without restoring it is not supported" + exit 1 + shell: bash + - uses: pnpm/action-setup@v4 + with: + version: ${{ inputs.pnpm-version }} + package_json_file: ${{ inputs.package-json }} + - uses: actions/setup-node@v4 + id: node + with: + node-version: ${{ inputs.node-version }} + cache: ${{ inputs.cache-save == 'true' && 'pnpm' || '' }} + cache-dependency-path: ${{ inputs.pnpm-lockfile }} + - id: pnpm + if: inputs.cache-save == 'false' && inputs.cache-restore == 'true' + run: pnpm store path --silent | xargs -I {} -0 echo "path={}" | tee -a $GITHUB_OUTPUT + shell: bash + - uses: actions/cache/restore@v4 + if: inputs.cache-save == 'false' && inputs.cache-restore == 'true' + with: + path: ${{ steps.pnpm.outputs.path }} + key: node-cache-${{ runner.os }}-pnpm-${{ hashFiles(inputs.pnpm-lockfile) }} diff --git a/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml b/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml index 6e79ca61eb..fcdf19ce3a 100644 --- a/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml +++ b/.github/workflows/LATEST_DEPENDENCY_VERSIONS.yml @@ -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 diff --git a/.github/workflows/check-docs-site.yml b/.github/workflows/check-docs-site.yml index d8800c1abc..02f5450d2a 100644 --- a/.github/workflows/check-docs-site.yml +++ b/.github/workflows/check-docs-site.yml @@ -19,15 +19,10 @@ jobs: working-directory: docs steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 + - uses: ./.github/actions/setup-env with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - cache-dependency-path: | - docs/pnpm-lock.yaml + pnpm-lockfile: docs/pnpm-lock.yaml + package-json: docs/package.json - name: Install Docs run: pnpm install --frozen-lockfile --prefer-offline - name: Build diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 08f1e47d12..071fcf076b 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -29,12 +29,10 @@ jobs: IS_WINDOWS: ${{ matrix.os == 'windows-latest' }} steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 + - uses: ./.github/actions/setup-env with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 + pnpm-lockfile: docs/pnpm-lock.yaml + package-json: docs/package.json - name: Run fixture-projects script run: | cd e2e diff --git a/.github/workflows/hardhat-ci.yml b/.github/workflows/hardhat-ci.yml index b195ebebf6..cb295902d3 100644 --- a/.github/workflows/hardhat-ci.yml +++ b/.github/workflows/hardhat-ci.yml @@ -149,13 +149,9 @@ jobs: working-directory: packages/${{ matrix.package }} 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_version }} - cache: pnpm - name: Install run: pnpm install --frozen-lockfile --prefer-offline - name: Build diff --git a/.github/workflows/hardhat-core-ci.yml b/.github/workflows/hardhat-core-ci.yml index 627b17238a..268084fd8b 100644 --- a/.github/workflows/hardhat-core-ci.yml +++ b/.github/workflows/hardhat-core-ci.yml @@ -41,14 +41,9 @@ jobs: steps: - 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 @@ -83,14 +78,9 @@ jobs: steps: - 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 @@ -121,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 diff --git a/.github/workflows/hardhat-network-tracing-all-solc-versions.yml b/.github/workflows/hardhat-network-tracing-all-solc-versions.yml index b5523580ff..b6c4251c18 100644 --- a/.github/workflows/hardhat-network-tracing-all-solc-versions.yml +++ b/.github/workflows/hardhat-network-tracing-all-solc-versions.yml @@ -22,13 +22,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: Build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a6640bfd86..210ba60ab9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,15 +26,10 @@ jobs: working-directory: ${{ matrix.working-directory || github.workspace }} steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 + - uses: ./.github/actions/setup-env with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - cache-dependency-path: | - ${{ matrix.working-directory || '.' }}/pnpm-lock.yaml + pnpm-lockfile: ${{ matrix.working-directory || '.' }}/pnpm-lock.yaml + package-json: ${{ matrix.working-directory || '.' }}/package.json - name: Install run: pnpm install --frozen-lockfile --prefer-offline # Linting under the root directory requires build because some packages diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml new file mode 100644 index 0000000000..0b4a6554a7 --- /dev/null +++ b/.github/workflows/populate-cache.yml @@ -0,0 +1,37 @@ +name: Populate cache + +on: + push: + paths: + - ".github/workflows/populate-cache.yml" + - "pnpm-lock.yaml" + - "docs/pnpm-lock.yaml" + workflow_dispatch: + +concurrency: + group: ${{github.workflow}}-${{github.ref}} + cancel-in-progress: true + +jobs: + cache: + name: Populate cache + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + runner: ["ubuntu-latest", "macos-latest", "windows-latest"] + working-directory: ["", "docs"] + defaults: + run: + working-directory: ${{ matrix.working-directory || github.workspace }} + steps: + - uses: actions/checkout@v4 + - id: env + uses: ./.github/actions/setup-env + with: + cache-save: true + pnpm-lockfile: ${{ matrix.working-directory || '.' }}/pnpm-lock.yaml + package-json: ${{ matrix.working-directory || '.' }}/package.json + - name: Install + if: steps.env.outputs.cache-hit != 'true' + run: pnpm install --frozen-lockfile --prefer-offline diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index d08e3bcfc6..345d54c747 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -17,13 +17,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: Build @@ -52,13 +46,7 @@ jobs: working-directory: packages/hardhat-core 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: Cache network requests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d49ad9b64..5f560ad3b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,16 +19,9 @@ jobs: # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits fetch-depth: 0 - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Setup Node.js 18.x - uses: actions/setup-node@v4 + - uses: ./.github/actions/setup-env with: node-version: 18.x - cache: "pnpm" - name: Install Dependencies run: pnpm install --frozen-lockfile --prefer-offline diff --git a/.github/workflows/test-slow-imports-rule.yml b/.github/workflows/test-slow-imports-rule.yml index 6f6d2a3847..6846e721a0 100644 --- a/.github/workflows/test-slow-imports-rule.yml +++ b/.github/workflows/test-slow-imports-rule.yml @@ -22,13 +22,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: Add slow import From 89272363e6a3850123e7eab16348d1e74c2b3144 Mon Sep 17 00:00:00 2001 From: galargh Date: Fri, 31 May 2024 13:12:32 +0100 Subject: [PATCH 8/9] Review workflow triggers --- .github/workflows/check-docs-site.yml | 3 ++- .github/workflows/e2e-tests.yml | 4 +--- .github/workflows/hardhat-ci.yml | 2 -- .github/workflows/hardhat-core-ci.yml | 2 -- .github/workflows/lint.yml | 2 -- .github/workflows/populate-cache.yml | 9 +++++++++ .github/workflows/test-slow-imports-rule.yml | 7 ++++++- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/check-docs-site.yml b/.github/workflows/check-docs-site.yml index 02f5450d2a..635259b94a 100644 --- a/.github/workflows/check-docs-site.yml +++ b/.github/workflows/check-docs-site.yml @@ -3,7 +3,8 @@ name: Check Docs Site on: push: branches: - - "**" + - main + pull_request: workflow_dispatch: concurrency: diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 071fcf076b..70435495df 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -3,10 +3,8 @@ name: E2E tests on: push: branches: - - "main" + - main pull_request: - branches: - - "main" jobs: run-e2e: diff --git a/.github/workflows/hardhat-ci.yml b/.github/workflows/hardhat-ci.yml index cb295902d3..90e4c45a6d 100644 --- a/.github/workflows/hardhat-ci.yml +++ b/.github/workflows/hardhat-ci.yml @@ -5,8 +5,6 @@ on: branches: - main pull_request: - branches: - - "**" workflow_dispatch: concurrency: diff --git a/.github/workflows/hardhat-core-ci.yml b/.github/workflows/hardhat-core-ci.yml index 268084fd8b..e9a6e90f65 100644 --- a/.github/workflows/hardhat-core-ci.yml +++ b/.github/workflows/hardhat-core-ci.yml @@ -12,8 +12,6 @@ on: - "packages/hardhat-core/**" - "packages/hardhat-common/**" pull_request: - branches: - - "**" paths: - ".github/workflows/hardhat-core-ci.yml" - "config/**" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 210ba60ab9..524f501c57 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,8 +5,6 @@ on: branches: - main pull_request: - branches: - - "**" workflow_dispatch: concurrency: diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index 0b4a6554a7..ab58361398 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -2,6 +2,15 @@ name: Populate cache on: push: + branches: + - main + - pre-release-testing-branch + - changeset-release/main + paths: + - ".github/workflows/populate-cache.yml" + - "pnpm-lock.yaml" + - "docs/pnpm-lock.yaml" + pull_request: paths: - ".github/workflows/populate-cache.yml" - "pnpm-lock.yaml" diff --git a/.github/workflows/test-slow-imports-rule.yml b/.github/workflows/test-slow-imports-rule.yml index 6846e721a0..537289f490 100644 --- a/.github/workflows/test-slow-imports-rule.yml +++ b/.github/workflows/test-slow-imports-rule.yml @@ -7,10 +7,15 @@ name: Slow imports rule check on: schedule: - cron: "0 0 * * *" - workflow_dispatch: push: + branches: + - main + paths: + - ".github/workflows/test-slow-imports-rule.yml" + pull_request: paths: - ".github/workflows/test-slow-imports-rule.yml" + workflow_dispatch: defaults: run: From 1911acf1a6f27e17241283f7390050d881832d10 Mon Sep 17 00:00:00 2001 From: galargh Date: Fri, 7 Jun 2024 20:56:15 +0100 Subject: [PATCH 9/9] Restore pull_request_target trigger in lint workflow --- .github/workflows/comment-on-linter-error.yml | 39 ---------------- .github/workflows/lint.yml | 46 ++++++++++++++++--- 2 files changed, 40 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/comment-on-linter-error.yml diff --git a/.github/workflows/comment-on-linter-error.yml b/.github/workflows/comment-on-linter-error.yml deleted file mode 100644 index 6657546e7f..0000000000 --- a/.github/workflows/comment-on-linter-error.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Comment on lint failure - -on: - workflow_run: - workflows: - - Lint - types: - - completed - -concurrency: - group: "${{github.workflow}}-${{github.event.workflow_run.event}}-${{github.event.workflow_run.head_repository.full_name}}:${{github.event.workflow_run.head_branch}}" - cancel-in-progress: true - -jobs: - comment_on_lint_failure: - name: Comment on lint failure - runs-on: ubuntu-latest - if: | - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'failure' - steps: - - uses: ipdxco/workflow-run-context@492ea3967eb2ca7ed76b7888b42fa7649addd975 # v1.1.1 - name: Get workflow run context - id: context - with: - artifacts-url: ${{ github.event.workflow_run.artifacts_url }} - artifact-names: event - - uses: actions/github-script@v7 - name: Comment on failure - env: - NUMBER: ${{ fromJSON(steps.context.outputs.artifacts)['event'].files['event.json'].number }} - with: - script: | - github.rest.issues.createComment({ - issue_number: process.env.NUMBER, - owner: context.repo.owner, - repo: context.repo.repo, - body: "Thanks for submitting this PR!\n\nUnfortunately, it has some linter errors, so we can't merge it yet. Can you please fix them?\n\nRunning pnpm lint:fix in the root of the repository may fix them automatically." - }) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 524f501c57..c46f567df3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,15 +6,26 @@ on: - main pull_request: workflow_dispatch: + # Triggering on pull_request_target to provide quick feedback before + # all the other workflow runs triggered on pull_request are approved + pull_request_target: + types: + - opened + branches: + - main concurrency: - group: ${{github.workflow}}-${{github.ref}} + group: ${{github.workflow}}-${{github.event_name}}-${{github.event_name == 'pull_request_target' && github.event.number || github.ref}} cancel-in-progress: true jobs: lint: name: Lint runs-on: ubuntu-latest + # Keeping permissions to a minimum to avoid leaking sensitive information + # on runs triggered by pull_request_target + permissions: + contents: read strategy: fail-fast: false matrix: @@ -23,7 +34,20 @@ jobs: run: working-directory: ${{ matrix.working-directory || github.workspace }} steps: + # Checking out both the default branch and the PR branch on pull_request_target + # to allow checking out sensitive files from the default branch - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/checkout@v4 + if: github.event_name == 'pull_request_target' + with: + ref: "refs/pull/${{ github.event.number }}/merge" + persist-credentials: false + - if: github.event_name == 'pull_request_target' + run: | + git checkout $GITHUB_SHA --no-overlay -- .github/actions/setup-env + working-directory: ${{ github.workspace }} - uses: ./.github/actions/setup-env with: pnpm-lockfile: ${{ matrix.working-directory || '.' }}/pnpm-lock.yaml @@ -40,11 +64,21 @@ jobs: - name: Check dependency versions if: matrix.working-directory == '' run: node scripts/check-dependencies.js - save_event: - name: Save event + comment: + needs: [lint] + if: failure() && github.event_name == 'pull_request_target' && needs.lint.result == 'failure' + name: Comment runs-on: ubuntu-latest + permissions: + pull-requests: write steps: - - uses: actions/upload-artifact@v4 + - uses: actions/github-script@v6 + name: Comment on failure with: - name: event - path: ${{ github.event_path }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "Thanks for submitting this PR!\n\nUnfortunately, it has some linter errors, so we can't merge it yet. Can you please fix them?\n\nRunning pnpm lint:fix in the root of the repository may fix them automatically." + })