diff --git a/.github/workflows/ci-all-via-ir.yml b/.github/workflows/ci-all-via-ir.yml index 6edfe6089..27ae82db7 100644 --- a/.github/workflows/ci-all-via-ir.yml +++ b/.github/workflows/ci-all-via-ir.yml @@ -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" ] && @@ -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 && diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 593c68df1..78b14fb58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/.github/workflows/gas-diff-comment.yml b/.github/workflows/gas-diff-comment.yml new file mode 100644 index 000000000..98bd25074 --- /dev/null +++ b/.github/workflows/gas-diff-comment.yml @@ -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<> $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 }} \ No newline at end of file