Skip to content

Commit

Permalink
fix: ci tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Maldonado <[email protected]>
  • Loading branch information
md0x committed Oct 27, 2023
1 parent a07ada6 commit 27b3761
Showing 1 changed file with 70 additions and 22 deletions.
92 changes: 70 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,83 @@
name: CI
on:
push:
branches:
- master
pull_request:
name: "Contracts CI"

env:
FOUNDRY_PROFILE: ci
FOUNDRY_PROFILE: "ci"

on: [push]

jobs:
run-ci:
runs-on: ubuntu-latest
lint:
defaults:
run:
working-directory: "./"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
token: ${{ secrets.GH_TOKEN }}
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: Checkout modules
uses: actions/checkout@v2
- name: "Lint the contracts"
run: "forge fmt"

- name: "Add lint summary"
run: |
echo "## Lint result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
build:
runs-on: "ubuntu-latest"
defaults:
run:
working-directory: "./"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
token: ${{ secrets.GH_TOKEN }}
submodules: recursive
submodules: "recursive"

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- 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"]
defaults:
run:
working-directory: "./"
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
with:
version: nightly
token: ${{ secrets.GH_TOKEN }}
submodules: "recursive"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: "Show the Foundry config"
run: "forge config"

- name: Install deps
run: forge install
- name: "Run the tests"
env:
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
run: "forge test --fork-url $RPC_MAINNET"

- name: Check gas snapshots
run: forge snapshot --check
- name: "Add test summary"
run: |
echo "## Tests result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
- name: Run tests
run: forge test

0 comments on commit 27b3761

Please sign in to comment.