From 21fef78b527c20beb5a53bd1ec4e6d212203549f Mon Sep 17 00:00:00 2001 From: Marco Tabasco Date: Fri, 3 May 2024 16:52:10 +0200 Subject: [PATCH] CI forked tests action --- .github/workflows/tests-forked.yaml | 18 ++++++++++++++++++ hardhat.config.ts | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/tests-forked.yaml diff --git a/.github/workflows/tests-forked.yaml b/.github/workflows/tests-forked.yaml new file mode 100644 index 00000000..656ce3b2 --- /dev/null +++ b/.github/workflows/tests-forked.yaml @@ -0,0 +1,18 @@ +name: Run tests + +on: [push] + +jobs: + ci: + runs-on: ubuntu-latest + name: Hardhat unit test + env: # Set environment variables for all steps in this job + GH_TOKEN: ${{ secrets.github_token }} + FORK_TESTING_ENABLED: true + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + - run: npm ci + - run: npx hardhat test test-forked/*.ts diff --git a/hardhat.config.ts b/hardhat.config.ts index db5b1df8..0b3d97df 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -9,7 +9,7 @@ import '@openzeppelin/hardhat-upgrades'; import 'hardhat-abi-exporter'; import 'hardhat-contract-sizer'; -import 'solidity-coverage' +import 'solidity-coverage'; import './tasks/deploy'; import './tasks/update-module'; @@ -50,7 +50,7 @@ const config: HardhatUserConfig = { } as SSVNetworkConfig, hardhat: { forking: { - enabled: process.env.FORK_TESTING_ENABLED ? true : false, + enabled: process.env.FORK_TESTING_ENABLED === 'true', url: process.env.MAINNET_ETH_NODE_URL, blockNumber: 19621100, },