-
-
Notifications
You must be signed in to change notification settings - Fork 378
45 lines (38 loc) · 1.18 KB
/
submit_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: Submit coverage
# read-write repo token
# access to secrets
on:
workflow_run:
workflows: [Build and test]
types: [completed]
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
jobs:
upload:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v7
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: coveralls.json
- name: 'Prepare dependencies'
run: |
sudo apt-get update && \
sudo apt-get install -yq \
jq \
curl
shell: bash
- name: 'Generate full report'
run: |
cat coveralls.json | jq --arg repo_token $COVERALLS_REPO_TOKEN '. += {repo_token: $repo_token}' > coveralls_full.json
shell: bash
- name: 'Upload final report'
run: |
curl --request POST \
--url https://coveralls.io/api/v1/jobs \
--header 'Content-Type: multipart/form-data' \
--form json_file=@./coveralls_full.json
shell: bash