From 2c7e3f34fed0469dad520b86ebac81850aace6dc Mon Sep 17 00:00:00 2001 From: Paul Razvan Berg Date: Fri, 30 Jun 2023 19:56:06 +0300 Subject: [PATCH] ci: workflow for deep fuzzing --- .github/workflows/ci-deep.yml | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/ci-deep.yml diff --git a/.github/workflows/ci-deep.yml b/.github/workflows/ci-deep.yml new file mode 100644 index 00000000..783ef6a6 --- /dev/null +++ b/.github/workflows/ci-deep.yml @@ -0,0 +1,71 @@ +name: "CI Deep" + +env: + RPC_URL_GOERLI: ${{ secrets.RPC_URL_GOERLI }} + +on: + schedule: + - cron: "0 3 * * 0" # at 3:00am UTC every Sunday + workflow_dispatch: + inputs: + forkFuzzRuns: + default: "250" + description: "Number of fuzz runs for each fork test." + required: false + +jobs: + lint: + runs-on: "ubuntu-latest" + steps: + - name: "Check out the repo" + uses: "actions/checkout@v3" + + - name: "Install Foundry" + uses: "foundry-rs/foundry-toolchain@v1" + + - name: "Install Pnpm" + uses: "pnpm/action-setup@v2" + with: + version: "8" + + - name: "Install Node.js" + uses: "actions/setup-node@v3" + with: + cache: "pnpm" + node-version: "lts/*" + + - name: "Install the Node.js dependencies" + run: "pnpm install" + + - name: "Lint the contracts" + run: "pnpm lint" + + - name: "Add lint summary" + run: | + echo "## Lint result" >> $GITHUB_STEP_SUMMARY + echo "✅ Passed" >> $GITHUB_STEP_SUMMARY + + test: + env: + FOUNDRY_FUZZ_RUNS: ${{ inputs.forkFuzzRuns || '250' }} + needs: "lint" + runs-on: "ubuntu-latest" + steps: + - name: "Check out the repo" + uses: "actions/checkout@v3" + with: + submodules: "recursive" + + - name: "Install Foundry" + uses: "foundry-rs/foundry-toolchain@v1" + + - name: "Produce an optimized build with --via-ir" + run: "FOUNDRY_PROFILE=optimized forge build" + + - name: "Run the fork tests against the optimized build" + run: "FOUNDRY_PROFILE=test-optimized forge test --match-path \"test/fork/**/*.sol\"" + + - name: "Add test summary" + run: | + echo "## Fork tests result" >> $GITHUB_STEP_SUMMARY + echo "✅ Passed" >> $GITHUB_STEP_SUMMARY