Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-all-via-ir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
- name: Install Dependencies
run: forge install

# NOTE: skipping solc 0.8.32 due to compiler bug
# https://github.com/argotorg/solidity/issues/16360
- name: Run Tests with ${{ matrix.profile }}
run: >
( [ "${{ matrix.profile }}" = "via-ir-0" ] &&
Expand All @@ -45,8 +47,6 @@ jobs:
forge test --use 0.8.16 --via-ir &&
forge test --use 0.8.17 --via-ir
) ||
# NOTE: skipping solc 0.8.32 due to compiler bug
# https://github.com/argotorg/solidity/issues/16360
( [ "${{ matrix.profile }}" = "via-ir-3" ] &&
forge test --use 0.8.33 --via-ir &&
forge test --use 0.8.31 --via-ir &&
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,19 @@ jobs:
- name: Generate gas diff
uses: atarpara/foundry-snapshot-diff@v0.8
id: gas_diff
- name: Add gas diff to sticky comment
uses: marocchino/sticky-pull-request-comment@v2
- name: Save gas diff output
if: steps.gas_diff.outputs.markdown
run: |
mkdir -p ./gas-diff
echo "${{ steps.gas_diff.outputs.markdown }}" > ./gas-diff/comment.md
echo "${{ github.event.number }}" > ./gas-diff/pr-number.txt
- name: Upload gas diff artifact
if: steps.gas_diff.outputs.markdown
uses: actions/upload-artifact@v4
with:
delete: ${{ !steps.gas_diff.outputs.markdown }}
message: ${{ steps.gas_diff.outputs.markdown }}
name: gas-diff
path: gas-diff/


prep-checker:
runs-on: ${{ matrix.os }}
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/gas-diff-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Post Gas Diff Comment

on:
workflow_run:
workflows: ["ci"]
types:
- completed

jobs:
comment:
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Download gas diff artifact
uses: actions/download-artifact@v4
with:
name: gas-diff
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Read PR number
id: pr
run: echo "number=$(cat pr-number.txt)" >> $GITHUB_OUTPUT
- name: Read gas diff
id: gas_diff
run: |
if [ -f comment.md ]; then
echo "markdown<<EOF" >> $GITHUB_OUTPUT
cat comment.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
- name: Add gas diff to sticky comment
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.pr.outputs.number }}
delete: ${{ !steps.gas_diff.outputs.markdown }}
message: ${{ steps.gas_diff.outputs.markdown }}