-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (67 loc) · 2.25 KB
/
unitTest.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
74
75
76
77
78
name: L1 Unit Test
on:
push:
branches: [ main, develop]
merge_group:
pull_request:
branches: [ main, develop ]
jobs:
L1Tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7' # Not needed with a `.ruby-version` or `.tool-versions`
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup deps
run: |
sudo apt-get update
echo 'DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"' >> $GITHUB_ENV
sudo apt-get install -y ruby-full libglib2.0-dev libcjson-dev gcovr
sudo apt-get purge -y ccache
- name: Install bundler
run: |
gem install bundler -v 2.4.22
- name: Clone and setup CMock
run: |
git clone https://github.com/ThrowTheSwitch/CMock.git /opt/CMock
cd /opt/CMock
git checkout v2.5.3
bundle install
gem install ceedling -v 0.31.1
- name: download btcore
run: |
git clone https://${{ secrets.RDKCM_RDKE }}@github.com/rdkcentral/bluetooth.git src/btrcore/
- name: download bluez
run: |
git clone https://github.com/bluez/bluez.git
git -C bluez checkout tags/5.48
mkdir -p unitTest/support/include/bluetooth/audio/
mv bluez/profiles/audio/a2dp-codecs.h unitTest/support/include/bluetooth/audio/a2dp-codecs.h
mv bluez/lib/bluetooth.h unitTest/support/include/bluetooth/bluetooth.h
- name: Run Unit Tests
run: |
ceedling gcov:all utils:gcov
coverage=$(gcovr -r . -s 2>/dev/null | grep 'executed' | awk '{print $3}')
- name: Generate HTML Report
uses: threeal/gcovr-action@v1.1.0
with:
excludes: |
build/test/mocks
build/test/runners
unitTest/
html-details: true
html-out: summary-coverage.html
- name: Move HTML files to own directory
run: |
mkdir coverage-results
ls
pwd
mv *.html coverage-results
mv *.css coverage-results
- name: Upload HTML Report
uses: actions/upload-artifact@v4
with:
name: Unit-test-coverage-report
path: ./coverage-results