-
Notifications
You must be signed in to change notification settings - Fork 128
140 lines (123 loc) · 5.01 KB
/
Test Thunder.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Test Thunder
on:
workflow_dispatch:
push:
branches: ["master"]
paths-ignore:
- 'doc/**'
- 'docs/**'
- 'ReleaseNotes/**'
pull_request:
branches: ["master"]
paths-ignore:
- 'doc/**'
- 'docs/**'
- 'ReleaseNotes/**'
jobs:
Thunder:
runs-on: ubuntu-24.04
strategy:
matrix:
build_type: [Debug, Release, MinSizeRel]
shared_libs: [ON, OFF]
env:
lib: LD_LIBRARY_PATH=${{github.workspace}}/${{matrix.build_type}}/install/usr/lib:$LD_LIBRARY_PATH
path: PATH=${{github.workspace}}/${{matrix.build_type}}/install/usr/bin:$PATH
name: Testing - ${{matrix.shared_libs == 'OFF' && 'Static ' || ''}}${{matrix.build_type}}
steps:
# ----- Installing packages -----
- name: Install necessary packages
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 10
command: |
sudo gem install apt-spy2
sudo apt-spy2 fix --commit --launchpad --country=US
sudo apt-get update
sudo apt install python3-pip build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev libgtest-dev
python3 -m venv venv
source venv/bin/activate
pip install jsonref
# ----- Checkout & DependsOn Regex -----
# -------------- Thunder ---------------
- name: Checkout Thunder - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=Thunder:') }}
uses: actions/checkout@v4
with:
path: Thunder
repository: rdkcentral/Thunder
- name: Regex Thunder
if: contains(github.event.pull_request.body, '[DependsOn=Thunder:')
id: thunder
uses: AsasInnab/regex-action@v1
with:
regex_pattern: '(?<=\[DependsOn=Thunder:).*(?=\])'
regex_flags: 'gim'
search_string: ${{github.event.pull_request.body}}
- name: Checkout Thunder - ${{steps.thunder.outputs.first_match}}
if: contains(github.event.pull_request.body, '[DependsOn=Thunder:')
uses: actions/checkout@v4
with:
path: Thunder
repository: rdkcentral/Thunder
ref: ${{steps.thunder.outputs.first_match}}
# -------------- ThunderTools -------------
- name: Checkout ThunderTools - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=ThunderTools:') }}
uses: actions/checkout@v4
with:
path: ThunderTools
repository: rdkcentral/ThunderTools
- name: Regex ThunderTools
if: contains(github.event.pull_request.body, '[DependsOn=ThunderTools:')
id: tools
uses: AsasInnab/regex-action@v1
with:
regex_pattern: '(?<=\[DependsOn=ThunderTools:).*(?=\])'
regex_flags: 'gim'
search_string: ${{github.event.pull_request.body}}
- name: Checkout ThunderTools - ${{steps.tools.outputs.first_match}}
if: contains(github.event.pull_request.body, '[DependsOn=ThunderTools:')
uses: actions/checkout@v4
with:
path: ThunderTools
repository: rdkcentral/ThunderTools
ref: ${{steps.tools.outputs.first_match}}
# ----- Building -----
- name: Install generators
run: |
source venv/bin/activate
cmake -G Ninja -S ThunderTools -B ${{matrix.build_type}}/build/ThunderTools \
-DCMAKE_INSTALL_PREFIX=${{matrix.build_type}}/install/usr
cmake --build ${{matrix.build_type}}/build/ThunderTools --target install
- name: Build Thunder
run: |
source venv/bin/activate
cmake -G Ninja -S Thunder -B ${{matrix.build_type}}/build/Thunder \
-DBINDING="127.0.0.1" \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DBUILD_SHARED_LIBS=${{matrix.shared_libs}} \
-DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
-DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \
-DDATA_PATH="${PWD}/${{matrix.build_type}}/install/usr/share/WPEFramework" \
-DPERSISTENT_PATH="${PWD}/${{matrix.build_type}}/install/var/wpeframework" \
-DPORT="55555" \
-DPROXYSTUB_PATH="${PWD}/${{matrix.build_type}}/install/usr/lib/wpeframework/proxystubs" \
-DSYSTEM_PATH="${PWD}/${{matrix.build_type}}/install/usr/lib/wpeframework/plugins" \
-DVOLATILE_PATH="tmp" \
-DBUILD_TESTS=ON
cmake --build ${{matrix.build_type}}/build/Thunder --target install
# ----- Running tests -----
- name: Run IPTestAdministrator unit test
run: ${{env.path}} ${{env.lib}} Thunder_test_tests
- name: Run core unit tests
run: ${{env.path}} ${{env.lib}} Thunder_test_core
# ----- Uploading artifact -----
- name: Tar files
run: tar -czvf ${{matrix.shared_libs == 'OFF' && 'Static-' || ''}}${{matrix.build_type}}.tar.gz ${{matrix.build_type}}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Thunder-${{matrix.shared_libs == 'OFF' && 'Static-' || ''}}${{matrix.build_type}}-artifact
path: ${{matrix.shared_libs == 'OFF' && 'Static-' || ''}}${{matrix.build_type}}.tar.gz