glog/.github/workflows/coveralls.yml
Workflow config file is invalid. Please check your config file: yaml: line 10: did not find expected key
2021-11-19 21:15:37 +01:00

71 lines
2.0 KiB
YAML

name: Coveralls
on:
workflow_run:
workflows: [Linux]
types:
- completed
jobs:
finish:
defaults:
run:
shell: bash
runs-on: ubuntu-latest
steps:
- name: 'Download artifacts'
uses: actions/github-script@v3.1.0
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id}},
});
var matchArtifacts = artifacts.data.artifacts;
matchArtifacts.forEach(artifact => {
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/' + artifact.name + '.zip', Buffer.from(download.data));
});
- run: |
unzip *.zip
- name: Generate Coverage
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info \
'*/install/include/*' \
'*/msys64/mingw32/*' \
'*/msys64/mingw64/*' \
'*/src/*_unittest.cc' \
'*/src/googletest.h' \
'*/src/mock-log.h' \
'/usr/*' \
--output-file coverage.info
readarray -t build_dirs < <(ls -d build*/)
for file in src/glog/*.h.in; do
name=$(basename ${file})
name_we=${name%.h.in}
for build_dir in ${build_dirs[@]}; do
sed -i "s|${build_dir%/}/glog/${name_we}.h\$|${file}|g" coverage.info
done
done
lcov --list coverage.info
- name: Upload Coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.info