Skip to content

Commit

Permalink
Create coverage-upload.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yoanm authored Mar 27, 2024
1 parent 0bda487 commit 4d0a2e6
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/coverage-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'Coverage upload'
on:
workflow_run:
workflows: ["CI"]
types: [completed]

jobs:
fetch-info:
name: Fetch triggering workflow metadata
runs-on: ubuntu-latest
permissions:
contents: read
checks: write # For the check run creation !
steps:
- name: 'Check run ○'
uses: yoanm/temp-reports-group-workspace/.github/actions/attach-check-run-to-triggering-workflow-action@develop
with:
name: 'Fetch coverage info'
fails-on-triggering-workflow-failure: true

- uses: yoanm/temp-reports-group-workspace/.github/actions/fetch-workflow-metadata-action@develop
id: fetch-workflow-metadata

outputs:
commit-sha: ${{ steps.fetch-workflow-metadata.outputs.commit-sha }}
run-id: ${{ steps.fetch-workflow-metadata.outputs.run-id }}

codacy-uploader:
name: Codacy
needs: [fetch-info]
uses: yoanm/temp-reports-group-workspace/.github/workflows/codacy-upload-from-artifacts.yml@develop
permissions:
contents: read
checks: write # For the check run creation !
secrets:
PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
with:
artifact: coverage-group
run-id: ${{ needs.fetch-info.outputs.run-id }}
language: go
force-coverage-parser: go

codecov-uploader:
name: Codecov
needs: [fetch-info]
uses: yoanm/temp-reports-group-workspace/.github/workflows/codecov-upload-from-artifacts.yml@develop
permissions:
contents: read
checks: write # For the check run creation !
secrets:
TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
artifact: coverage-group
run-id: ${{ needs.fetch-info.outputs.run-id }}
override-commit: ${{ needs.fetch-info.outputs.commit-sha }}
override-branch: ${{ needs.fetch-info.outputs.branch }}
override-pr: ${{ needs.fetch-info.outputs.pr-number }}
override-build: ${{ needs.fetch-info.outputs.run-id }}
override-build-url: ${{ needs.fetch-info.outputs.run-url }}

0 comments on commit 4d0a2e6

Please sign in to comment.