feat: Improvements #518
Workflow file for this run
This file contains 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: | |
FOUNDRY_PROFILE: "ci" | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out the repo" | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: "Install Node.js" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
- name: "Install the Node.js dependencies" | |
run: npm install | |
- name: Run linter and check for errors | |
id: lint | |
run: | | |
LINT_OUTCOME=$(npm run lint 2>&1 || true) # Prevent the step from failing immediately | |
echo "$LINT_OUTCOME" | |
echo "LINT_OUTCOME<<EOF" >> $GITHUB_ENV | |
echo "$LINT_OUTCOME" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
if echo "$LINT_OUTCOME" | grep -q " error "; then | |
echo "## Lint result" >> $GITHUB_STEP_SUMMARY | |
echo "❌ Failed due to errors" >> $GITHUB_STEP_SUMMARY | |
exit 1 | |
else | |
echo "## Lint result" >> $GITHUB_STEP_SUMMARY | |
echo "✅ Passed or warnings found" >> $GITHUB_STEP_SUMMARY | |
fi | |
integration-test: | |
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: "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: "Build the contracts and print their size" | |
run: "forge build --sizes" | |
- name: "Proposal Simulator Integration Tests" | |
run: "forge test --mc IntegrationTest" | |
- name: "Add test summary" | |
run: | | |
echo "## Proposal simulator tests result" >> $GITHUB_STEP_SUMMARY | |
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY | |
addresses-test: | |
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: "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: "Build the contracts and print their size" | |
run: "forge build --sizes" | |
- name: "Run the tests" | |
run: "forge test --mc TestAddresses" | |
- name: "Add test summary" | |
run: | | |
echo "## Proposal simulator tests result" >> $GITHUB_STEP_SUMMARY | |
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY |