2023-06-16 11:05:47 +00:00
|
|
|
name: Submit coverage
|
|
|
|
|
|
|
|
# read-write repo token
|
|
|
|
# access to secrets
|
|
|
|
on:
|
|
|
|
workflow_run:
|
2023-06-16 12:16:19 +00:00
|
|
|
workflows: [Build and test]
|
|
|
|
types: [completed]
|
2023-06-16 11:05:47 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
upload:
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-16 16:26:01 +00:00
|
|
|
if: github.event.workflow_run.conclusion == 'success'
|
2023-06-16 11:05:47 +00:00
|
|
|
steps:
|
|
|
|
- name: Download artifact
|
2024-03-10 12:11:54 +00:00
|
|
|
uses: dawidd6/action-download-artifact@v3
|
2023-06-16 11:05:47 +00:00
|
|
|
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'
|
2023-06-16 12:16:19 +00:00
|
|
|
run: |
|
|
|
|
cat coveralls.json | jq --arg repo_token $COVERALLS_REPO_TOKEN '. += {repo_token: $repo_token}' > coveralls_full.json
|
2023-06-16 11:05:47 +00:00
|
|
|
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
|