forked from pydata/pydata-sphinx-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (41 loc) · 1.5 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Post coverage comment
on:
workflow_call:
inputs:
# this is the workflow run ID of the `CI.yml` workflow
workflow_run_id:
required: true
type: string
jobs:
test:
name: "Display code coverage"
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write # needed to edit the comment vs opening multiple ones
actions: read
steps:
- name: "Get the triggering workflow run details"
id: get-run
uses: octokit/request-action@dad4362715b7fb2ddedf9772c8670824af564f0d
with:
route: GET /repos/"${REPO}"/actions/runs/"${WORKFLOW_RUN_ID}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
WORKFLOW_RUN_ID: ${{ inputs.workflow_run_id }}
# this needs the .coverage file so we download from the CI workflow artifacts
- name: "Download coverage data 📥"
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
pattern: coverage-data-*
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.workflow_run_id }}
- name: "Check downloaded files"
run: ls -R
- name: "Post coverage comment 💬"
uses: py-cov-action/python-coverage-comment-action@b2eb38dd175bf053189b35f738f9207278b00925
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ inputs.workflow_run_id }}