diff --git a/.github/workflows/report-coverage.yml b/.github/workflows/report-coverage.yml deleted file mode 100644 index 14b388e2d..000000000 --- a/.github/workflows/report-coverage.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Report Elixir Coverage - -on: # zizmor: ignore[dangerous-triggers] - workflow_run: - workflows: - - CI - types: - - completed - -permissions: - actions: read # needed to download workflow run artifacts - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.event.workflow_run.id }} - cancel-in-progress: true - -jobs: - report-coverage: - name: Report Coverage - if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - permissions: - actions: read # needed to download workflow run artifacts - contents: read - pull-requests: write # needed to post coverage comments - - steps: - - run: mkdir -p "${RUNNER_TEMP}/cover" - env: - RUNNER_TEMP: ${{ runner.temp }} - - run: echo "Fetching artifacts for ${WORKFLOW_RUN_ID}, event name ${GITHUB_EVENT_NAME}, triggered by ${GITHUB_EVENT_WORKFLOW_RUN_EVENT}" - env: - WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }} - GITHUB_EVENT_NAME: ${{ github.event_name }} - GITHUB_EVENT_WORKFLOW_RUN_EVENT: ${{ github.event.workflow_run.event }} - - name: Download artifact - uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 - env: - WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }} - RUNNER_TEMP: ${{ runner.temp }} - with: - script: | - var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: process.env.WORKFLOW_RUN_ID, - }); - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - return artifact.name == "elixir-lcov" - })[0]; - var download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync(process.env.RUNNER_TEMP + '/cover/elixir-lcov.zip', Buffer.from(download.data)); - - id: pr-info - working-directory: ${{ runner.temp }}/cover - run: | - unzip elixir-lcov.zip - # Sanitize artifact values: PR_SHA must be a hex SHA, PR_NUMBER must be numeric - PR_SHA_VAL=$(cat PR_SHA | tr -cd '[:xdigit:]' | head -c 40) - PR_NUMBER_VAL=$(cat PR_NUMBER | tr -cd '[:digit:]') - echo "PR_SHA=${PR_SHA_VAL}" >> $GITHUB_OUTPUT - echo "PR_NUMBER=${PR_NUMBER_VAL}" >> $GITHUB_OUTPUT - - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - UNTRUSTED CODE - do not run scripts from it - with: - ref: ${{ steps.pr-info.outputs.PR_SHA }} - persist-credentials: false - - name: Upload coverage artifact and post comment - uses: mbta/github-actions-report-lcov@9116c86aa5f59c26775d3b84c79ec5b2312301e5 # v1.4.1 - env: - PR_SHA: ${{ steps.pr-info.outputs.PR_SHA }} - PR_NUMBER: ${{ steps.pr-info.outputs.PR_NUMBER }} - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - coverage-files: ${{ runner.temp }}/cover/lcov*.info - artifact-name: elixir-code-coverage