-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: gas + coverage report workflows #63
base: main
Are you sure you want to change the base?
Changes from 3 commits
c17d96f
d599722
0e78879
4e7fadc
7ff8361
d09e0c4
c0a886b
2fd5d36
6bedb6b
6327968
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Foundry Reports | ||
|
||
on: [push] | ||
|
||
concurrency: | ||
group: ${{github.workflow}}-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
env: | ||
MAINNET_RPC: ${{ secrets.MAINNET_RPC }} | ||
SEPOLIA_RPC: ${{ secrets.SEPOLIA_RPC }} | ||
|
||
jobs: | ||
generate-gas-report: | ||
name: Generate Foundry Gas Reports | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'yarn' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you upgrade those actions to v4? See an example here: https://github.com/defi-wonderland/solidity-foundry-boilerplate/blob/main/.github/workflows/release.yml#L18-L31 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the same in the other action |
||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Install dependencies | ||
run: yarn --frozen-lockfile --network-concurrency 1 | ||
|
||
- name: Generate Gas Report | ||
run: forge test --gas-report > gas-report.txt | ||
|
||
- name: Trim Gas Report | ||
run: grep '^|' gas-report.txt > temp && mv temp gas-report.txt | ||
|
||
- name: Upload Gas Report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: gas-report | ||
path: gas-report.txt | ||
|
||
generate-coverage-report: | ||
name: Generate Foundry Coverage Reports | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'yarn' | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Install dependencies | ||
run: yarn --frozen-lockfile --network-concurrency 1 | ||
|
||
- name: Generate Test Coverage Table | ||
run: forge coverage > coverage-report.txt | ||
|
||
- name: Trim Coverage Report | ||
run: grep '^|' coverage-report.txt > temp && mv temp coverage-report.txt | ||
|
||
- name: Upload Test Coverage Table | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-coverage-report | ||
path: coverage-report.txt | ||
|
||
- name: Generate LCOV Test Coverage Report | ||
run: forge coverage --report lcov | ||
|
||
- name: Upload LCOV Test Coverage Report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: lcov-coverage-report | ||
path: lcov.info | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's please shorten the names a bit to "Gas Reports" and "Test Coverage"