From a7615a8d84ea1a41b587ae18a8192d46062aa17e Mon Sep 17 00:00:00 2001 From: mr-uniswap <144828035+mr-uniswap@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:27:06 -0400 Subject: [PATCH] Delete .github/workflows/coverage.yaml Signed-off-by: mr-uniswap <144828035+mr-uniswap@users.noreply.github.com> --- .github/workflows/coverage.yaml | 89 --------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml deleted file mode 100644 index 98e1130..0000000 --- a/.github/workflows/coverage.yaml +++ /dev/null @@ -1,89 +0,0 @@ -name: code coverage - -on: - pull_request: - branches: [main, master, staging, dev] - -jobs: - comment-forge-coverage: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - - steps: - - name: Checkout code - uses: actions/checkout@v3 - # with: - # token: ${{ secrets.GITHUB_TOKEN }} - - - 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 forge coverage - id: coverage - run: | - { - echo 'COVERAGE<> "$GITHUB_OUTPUT" - echo $GITHUB_OUTPUT - env: - FOUNDRY_RPC_URL: "${{ secrets.RPC_URL }}" - - - name: Check coverage is updated - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const fs = require('fs'); - const file = "coverage.txt" - if(!fs.existsSync(file)) { - console.log("Nothing to check"); - return - } - const currentCoverage = fs.readFileSync(file, "utf8").trim(); - const newCoverage = (`${{ steps.coverage.outputs.COVERAGE }}`).trim(); - if (newCoverage != currentCoverage) { - core.setFailed(`Code coverage not updated. Run : forge coverage --no-match-coverage "(test)" | grep '^|' > coverage.txt`); - } - - - name: Comment on PR - id: comment - uses: actions/github-script@v5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const {data: comments} = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - }) - - const botComment = comments.find(comment => comment.user.id === 41898282) - - const output = `${{ steps.coverage.outputs.COVERAGE }}`; - const commentBody = `Forge code coverage:\n${output}\n`; - - if (botComment) { - github.rest.issues.updateComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: botComment.id, - body: commentBody - }) - } else { - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: commentBody - }); - }