forked from vmware/concord-bft
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 2.1 KB
/
codecoverage.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
46
47
48
49
50
51
52
53
54
55
56
57
name: Code Coverage (Apollo tests)
on:
workflow_dispatch:
schedule:
- cron: "0 20 * * 6" # Every Saturday at 8PM UTC
jobs:
build:
name: Code coverage for Apollo Tests
runs-on: ubuntu-18.04
strategy:
fail-fast: false
steps:
- name: Cleanup pre-installed tools
run: |
# This is a fix for https://github.com/actions/virtual-environments/issues/1918
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout repository code
uses: actions/checkout@v2
- name: Create artifact directory
run: mkdir -p ${{ github.workspace }}/artifact
- name: Build and test
id: build_test
run: |
script -q -e -c "make pull"
sudo df -h
script -q -e -c "CONCORD_BFT_CONTAINER_CC=clang CONCORD_BFT_CONTAINER_CXX=clang++ \
CONCORD_BFT_CMAKE_CODECOVERAGE=TRUE CONCORD_BFT_CMAKE_TRANSPORT=UDP \
make build" && script -q -e -c "make test"
continue-on-error: true
- name: Generate code coverage report for apollo tests
if: always()
run: |
script -q -e -c "make codecoverage"
- name: Check for coveragereport directory
if: always()
run: |
./.github/success_action_if_codecoverage_reports_exist.sh ./build/tests/apollo/coveragereport
echo "indexfile_count=$(find build/tests/apollo/coveragereport -name index.html | wc -l)" > $GITHUB_ENV
- name: Prepare code coverage artifacts
if: ${{ env.indexfile_count > 0 }}
run: |
sudo chown -R ${USER}:${GROUP} ${PWD}/build
tar -czvf ${{ github.workspace }}/artifact/apollo-tests-codecoverage.tar.gz ./build/tests/apollo/coveragereport
du -h ${{ github.workspace }}/artifact
sudo df -h
- name: Upload code coverage artifacts
uses: actions/upload-artifact@v2
if: ${{ env.indexfile_count > 0 }}
with:
name: artifacts-${{ github.sha }}
path: ${{ github.workspace }}/artifact/