Skip to content

Commit

Permalink
refactor: ci
Browse files Browse the repository at this point in the history
refactor: remove gas report

fix: gas report

fix: gas report

refactor: continuous fuzzing

refactor: cleanup

feat: gas reporting

feat: intense continuous fuzzing

refactor: rename workflow files

refactor: renaming

refactor: ci

refactor: renaming

refactor: ci

feat: add `FOUNDRY_PROFILE=lite` to ci

refactor: small `foundry.toml` cleanup
  • Loading branch information
0xClandestine committed Dec 19, 2024
1 parent 8fb585a commit fce16bc
Show file tree
Hide file tree
Showing 11 changed files with 231 additions and 149 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/certora-prover.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Certora Prover
name: Check Certora

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: CI

on: [push, pull_request]
on:
push:
pull_request:
workflow_dispatch: {}

jobs:
commitlint:
name: Check Commit Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/continuous-fuzzing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
pull_request:
types: [opened, reopened]

env:
FOUNDRY_PROFILE: intense
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
RPC_HOLESKY: ${{ secrets.RPC_HOLESKY }}
CHAIN_ID: ${{ secrets.CHAIN_ID }}

jobs:
run-tests:
name: Continous Fuzzing
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: Checkout Layr-Labs/eigenlayer-contracts
uses: actions/checkout@v2

- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_21.x | sudo -E bash -
sudo apt-get install -y nodejs
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run unit and integration tests
run: forge test
17 changes: 2 additions & 15 deletions .github/workflows/deploy-local.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
name: Run Local Build
name: CI

on:
push:
workflow_dispatch: {}

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: Checkout code
uses: actions/checkout@v2

run-local-build:
needs: prepare
name: Check Deployment
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install lcov
run: |
sudo apt-get install lcov
id: lcov
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push]

jobs:
check-compilation:
name: Check Docker Compilation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,76 +1,72 @@
name: Run Coverage
name: CI

on:
push:
workflow_dispatch: {}

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

steps:
- name: Checkout code
uses: actions/checkout@v2

run-coverage:
needs: prepare
name: Check Coverage
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Load issue number
uses: actions/github-script@v6
id: get_issue_number
with:
script: |
let issue_number;
// Attempt to find a pull request associated with the commit
const pullRequests = await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
});
if (pullRequests.data.length > 0) {
issue_number = pullRequests.data[0].number;
return pullRequests.data[0].number;
} else {
throw new Error('No associated issue or pull request found.');
throw new Error('No associated pull request found.');
}
return issue_number;
result-encoding: string
- name: Checkout code
uses: actions/checkout@v2
- name: Install lcov

- name: Install dependencies
run: |
sudo apt-get install lcov
id: lcov

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run coverage
run: forge coverage --report lcov
run: FOUNDRY_PROFILE=ci forge coverage --report lcov
env:
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
RPC_HOLESKY: ${{ secrets.RPC_HOLESKY }}

- name: Prune coverage report
run: lcov --remove ./lcov.info -o ./lcov.info.pruned 'src/test/*' 'script/*' '*Storage.sol' --ignore-errors inconsistent

- name: Generate reports
run: genhtml -o report ./lcov.info.pruned
- name: Upload coverage results (s3 link here)

- name: Upload coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: report/*
- name: View Coverage (text here)

- name: View and log coverage
id: print_coverage
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "comment_contents<<$EOF" >> $GITHUB_OUTPUT
echo "$(lcov --list ./lcov.info.pruned --ignore-errors inconsistent)" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Log Coverage Report
run: echo "${{ steps.print_coverage.outputs.comment_contents }}"
run: echo "${{ steps.print_coverage.outputs.comment_contents }}"
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Lint and Check Format
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- "dev"

jobs:
check:
name: Check Forge Fmt
strategy:
fail-fast: true
name: Foundry Fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -21,7 +23,7 @@ jobs:
version: nightly
- name: Run forge fmt
run: |
forge fmt --check src/contracts
forge fmt --check
id: fmt
- name: install npm dependencies
run: npm install --include=dev
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/forge-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
pull_request:
types: [opened, reopened]

env:
FOUNDRY_PROFILE: ci
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
RPC_HOLESKY: ${{ secrets.RPC_HOLESKY }}
CHAIN_ID: ${{ secrets.CHAIN_ID }}

jobs:
run-tests:
name: Check Forge Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- name: Checkout Layr-Labs/eigenlayer-contracts
uses: actions/checkout@v2

- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_21.x | sudo -E bash -
sudo apt-get install -y nodejs
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run unit and integration tests
run: forge test

- name: Run integration mainnet fork tests
run: forge test --match-contract Integration
env:
FOUNDRY_PROFILE: "forktest"
5 changes: 4 additions & 1 deletion .github/workflows/storage-report.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Check Storage Layout
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- "dev"

jobs:
check_storage:
name: Check Storage Layout
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
Expand Down
65 changes: 0 additions & 65 deletions .github/workflows/testinparallel.yml

This file was deleted.

Loading

0 comments on commit fce16bc

Please sign in to comment.