Mapping key/value access in range based for loops #791
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Coverage | |
on: | |
push: | |
branches: | |
- develop | |
- main | |
paths: | |
- .github/workflows/coverage.yml | |
- cmake/** | |
- include/** | |
- tests/** | |
- CMakeLists.txt | |
- Makefile | |
# to grant pull-requests write permission to fork repos as well | |
pull_request_target: | |
paths: | |
- .github/workflows/coverage.yml | |
- cmake/** | |
- include/** | |
- tests/** | |
- CMakeLists.txt | |
- Makefile | |
workflow_dispatch: | |
jobs: | |
coverage: | |
timeout-minutes: 10 | |
runs-on: ubuntu-22.04 | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{github.head_ref}} | |
submodules: recursive | |
- name: Install lcov | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y lcov | |
lcov -v | |
- name: Generate coverage | |
run: make html-coverage | |
- name: Upload coverage to Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
file: ${{github.workspace}}/build_coverage/coverage/fkYAML.info | |
format: lcov | |
- name: Decide the artifact name | |
id: create_zip | |
if: github.event_name == 'pull_request_target' | |
env: | |
PR_NUMBER: ${{github.event.number}} | |
run: | | |
echo "artifact name: fkYAML_coverage.pr${{env.PR_NUMBER}}" | |
echo "artifact_name=fkYAML_coverage.pr${{env.PR_NUMBER}}" >> $GITHUB_OUTPUT | |
- name: Upload coverage as an artifact | |
id: upload_artifact_step | |
if: steps.create_zip.conclusion == 'success' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{steps.create_zip.outputs.artifact_name}} | |
path: | | |
${{github.workspace}}/build_coverage/coverage/* | |
${{github.workspace}}/build_coverage/html/** | |
overwrite: true | |
- name: Notify the artifact URL | |
if: steps.upload_artifact_step.conclusion == 'success' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
## :octocat: Upload Coverage Event Notification | |
Coverage data has been uploaded for the commit [${{github.event.pull_request.head.sha}}](https://github.com/${{github.repository}}/commit/${{github.event.pull_request.head.sha}}). | |
You can download the artifact which contains the same file uploaded to the Coveralls and its HTML version. | |
| Name | ${{steps.create_zip.outputs.artifact_name}}.zip | | |
|:-----|:-----------------------------------------------------| | |
| ID | ${{steps.upload_artifact_step.outputs.artifact-id}} | | |
| URL | ${{steps.upload_artifact_step.outputs.artifact-url}} | | |
comment_tag: notification |