HF-add-iBGT&iBERA-to-berachain #739
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI" | |
env: | |
API_KEY_ALCHEMY: ${{ secrets.API_KEY_ALCHEMY }} | |
FOUNDRY_PROFILE: "full_test" | |
EORACLE_CHAIN_ID: 42420 | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
jobs: | |
lint: | |
runs-on: "k8s-native" | |
container: | |
image: "node:22-bullseye" | |
steps: | |
- name: "Check out the repo" | |
uses: "actions/checkout@v4" | |
- name: "Setup Node.js" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "21.x" | |
- name: "Install Foundry" | |
uses: "foundry-rs/foundry-toolchain@v1" | |
with: | |
version: "nightly-cafc2606a2187a42b236df4aa65f4e8cdfcea970" | |
- name: "Install the Node.js dependencies" | |
run: "npm install" | |
- name: "Lint the code" | |
run: "npm run lint" | |
- name: "Add lint summary" | |
run: | | |
echo "## Lint result" >> $GITHUB_STEP_SUMMARY | |
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | |
build: | |
runs-on: "k8s-native" | |
container: | |
image: "node:22-bullseye" | |
steps: | |
- name: "Check out the repo" | |
uses: "actions/checkout@v4" | |
with: | |
submodules: "recursive" | |
- name: "Checkout OpenZeppelin Foundry Upgrades v0.2.2" | |
run: | | |
cd lib/openzeppelin-foundry-upgrades | |
git fetch --tags | |
git checkout v0.2.2 | |
- name: "Setup Node.js" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "21.x" | |
- name: "Install Foundry" | |
uses: "foundry-rs/foundry-toolchain@v1" | |
with: | |
version: "nightly-cafc2606a2187a42b236df4aa65f4e8cdfcea970" | |
- name: "Install the Node.js dependencies" | |
run: "npm install" | |
- name: "Configure Git" | |
run: | | |
git config --global --add safe.directory /__w/target-contracts/target-contracts | |
- name: "Update Foundry dependencies" | |
run: "forge update" | |
- name: "Build the contracts and print their size" | |
run: "forge build --sizes" | |
- name: "Add build summary" | |
run: | | |
echo "## Build result" >> $GITHUB_STEP_SUMMARY | |
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | |
test: | |
needs: ["lint", "build"] | |
runs-on: "k8s-native" | |
container: | |
image: "node:22-bullseye" | |
steps: | |
- name: "Check out the repo" | |
uses: "actions/checkout@v4" | |
with: | |
submodules: "recursive" | |
- name: "Setup Node.js" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "21.x" | |
- name: "Install Foundry" | |
uses: "foundry-rs/foundry-toolchain@v1" | |
- name: "Install the Node.js dependencies" | |
run: "npm install" | |
- name: "Configure Git" | |
run: | | |
git config --global --add safe.directory /__w/target-contracts/target-contracts | |
- name: "Update Foundry dependencies" | |
run: "forge update" | |
- name: "Checkout OpenZeppelin Foundry Upgrades v0.2.2" | |
run: | | |
cd lib/openzeppelin-foundry-upgrades | |
git fetch --tags | |
git checkout v0.2.2 | |
- name: "Show the Foundry config" | |
run: "forge config" | |
- name: "Generate a fuzz seed that changes weekly to avoid burning through RPC allowance" | |
run: > | |
echo "FOUNDRY_FUZZ_SEED=$( | |
echo $(($EPOCHSECONDS - $EPOCHSECONDS % 604800)) | |
)" >> $GITHUB_ENV | |
- name: "Run the tests" | |
run: "forge test --ffi" | |
- name: "Add test summary" | |
run: | | |
echo "## Tests result" >> $GITHUB_STEP_SUMMARY | |
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | |
slither-analyze: | |
runs-on: "k8s-dind" | |
permissions: | |
actions: "read" | |
contents: "read" | |
security-events: "write" | |
steps: | |
- name: "Check out the repo" | |
uses: "actions/checkout@v4" | |
with: | |
submodules: "recursive" | |
- name: "Setup Node.js" | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "21.x" | |
- name: "Install the Node.js dependencies" | |
run: "npm install" | |
- name: "Run Slither analysis" | |
uses: "crytic/slither-action@v0.3.0" | |
id: "slither" | |
with: | |
fail-on: "low" | |
sarif: "results.sarif" | |
- name: "Add summary" | |
run: | | |
echo "## Slither result" >> $GITHUB_STEP_SUMMARY |