Skip to content

bb-workflow#43

Open
itsshantanu wants to merge 1 commit intosablier-labs:mainfrom
itsshantanu:test/bb-ci
Open

bb-workflow#43
itsshantanu wants to merge 1 commit intosablier-labs:mainfrom
itsshantanu:test/bb-ci

Conversation

@itsshantanu
Copy link

This pull request adds a new GitHub Actions workflow to test Forge projects. The workflow is designed to streamline the process of building, caching, and running tests for Forge-based projects, with customizable inputs for fuzz testing and invariant checks. It also integrates BuildBear and Infura API keys for enhanced functionality.

New GitHub Actions Workflow for Forge Testing:

  • Workflow Definition: Added a new workflow named "Test a Forge project" to .github/workflows/bb-forge-test.yml. This workflow supports configurable inputs such as foundry-fuzz-runs, foundry-invariant-depth, and fuzz-seed, along with optional secrets like API_KEY_BUILDBEAR and MAINNET_RPC_URL.

  • Build and Cache Management: Implemented steps to clone our modified Foundry repository, restore/build the Forge binary, and manage caching for Foundry builds using actions/cache. This ensures efficient reuse of build artifacts.

  • Integration with BuildBear: Included a step to run BuildBear's CI action (BuildBearLabs/buildbear_x_action@v1.7.0) for additional analysis and reporting. Need to set API_KEY_BUILDBEAR for it to work.

@PaulRBerg
Copy link
Member

Hey @itsshantanu, thanks for your PR.

Before integrating a new tool (BuildBear) into our organization-wide GitHub utils, we would prefer to test it in an individual repo first, e.g.

cc @sablier-labs/evm

@smol-ninja
Copy link
Member

Thanks for the PR @itsshantanu and sorry for the delayed review. I have a few questions:

Clone Foundry repository

Do we need to clone foundry repo from BuildBearLabs? Can we not use the official foundry repo? How are they different?

Run BB Action CI

Can this action be available as a CLI so that we can test it in the terminal first? Testing this workflow would require the PRs to be merged first which we would like to avoid until we have tested it properly. Is there another way to test it?

@itsshantanu
Copy link
Author

Thanks @smol-ninja for the review! Let me address your questions:

Yes, it's necessary to use our BuildBearLabs Foundry repo, as we've modified it to fetch tests from Forge and re-simulate them on our side with chetcodes support.

We don’t have a CLI tool available at the moment. However, if you can share a separate test repository with us, we’d be happy to create a PR there to help test the action before merging it into the main repo.

Let us know how you'd like to proceed!

@smol-ninja
Copy link
Member

Can you please fork Lockup and setup bb-workflow on the forked repo?

@itsshantanu
Copy link
Author

@smol-ninja here is the forked Lockup repo with bb-workflow setup. You can check the actions on it.

@smol-ninja
Copy link
Member

Thanks @itsshantanu. I can see the action only ran for utils-tests. Out of curiosity, why not run the ci on the entire tests similar to ci.yml? Also, after it passes/fails, where do we see it on the bb ui?

@itsshantanu
Copy link
Author

@smol-ninja That's a valid observation. We're currently working on expanding support for additional Forge cheat codes, which is why the action currently targets only utils-tests. You can certainly run it across the full test suite as well, but please note that some tests might appear as failed due to incomplete support at this stage.

As for the results, you can view both passed and failed tests directly on the BB UI under the corresponding workflow run.

We're actively working on this and will get back to you with an updated version by Monday PT.

@smol-ninja
Copy link
Member

Thanks for the explanation @itsshantanu. That sounds good and I look forward to the updated version. Until then, is it OK if we close this PR and the associated sablier-labs/evm-monorepo#1262 PR since they are not complete? After you have the full PR ready, you can open a new PR for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants