-
Notifications
You must be signed in to change notification settings - Fork 29
73 lines (67 loc) · 2.25 KB
/
mc_dc_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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: CryptoLib Coverage
on:
push:
branches:
- 258-cyclomatic-complexity-and-mcdc-in-ci
pull_request:
branches:
- 258-cyclomatic-complexity-and-mcdc-in-ci
jobs:
coverage:
runs-on: ubuntu-latest
container:
image: ivvitc/cryptolib:20240814
steps:
- uses: actions/checkout@v4
- name: Update
run: apt-get update
- name: Install Dependencies
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
run: |
apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3 gcovr
- name: Install Python Libraries
run: pip install pycryptodome
- name: Install Libgcrypt
run: >
curl
-LS https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.50.tar.bz2
-o /tmp/libgpg-error-1.50.tar.bz2
&& tar -xjf /tmp/libgpg-error-1.50.tar.bz2 -C /tmp/
&& cd /tmp/libgpg-error-1.50
&& ./configure
&& make install
&& curl
-LS https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.0.tar.bz2
-o /tmp/libgcrypt-1.11.0.tar.bz2
&& tar -xjf /tmp/libgcrypt-1.11.0.tar.bz2 -C /tmp/
&& cd /tmp/libgcrypt-1.11.0
&& ./configure
&& make install
&& ldconfig
# End Container Setup
- name: Internal Build Script
working-directory: ${{github.workspace}}
run: |
# export CFLAGS="-fprofile-arcs -ftest-coverage -g"
bash ${GITHUB_WORKSPACE}/support/scripts/build_internal.sh
# Step 5: Generate Coverage Report
- name: Generate Coverage Report
run: |
mkdir -p coverage
gcovr --branches --html --html-details -o coverage/coverage_report.html
gcovr --branches --xml -o coverage/coverage_report.xml
# Step 6: Upload Coverage Report as an Artifact
- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: coverage
# # Step 7: Upload Coverage to GitHub Pages (Optional)
# - name: Deploy to GitHub Pages
# if: ${{ github.event_name == 'push' }}
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: coverage