Skip to content

PR code coverage (publish) #2585

PR code coverage (publish)

PR code coverage (publish) #2585

name: PR code coverage (publish)
on:
workflow_run:
workflows: [ "PR code coverage (generate)" ]
types: [ "completed" ]
jobs:
# This job downloads the artifacts generated by the code-cover-gen job and
# uploads them to a GCS bucket, from where Reviewable can access them.
code-cover-publish:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: 'Download artifact'
uses: actions/download-artifact@v4
with:
name: cover
path: cover
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.CODECOVER_SERVICE_ACCOUNT_KEY }}'
- name: 'Upload to GCS'
uses: 'google-github-actions/upload-cloud-storage@v1'
with:
path: 'cover'
glob: '**/cover-*.json'
parent: false
destination: 'crl-codecover-public/pr-pebble/'
process_gcloudignore: false