-
Notifications
You must be signed in to change notification settings - Fork 1
191 lines (176 loc) · 7.59 KB
/
02-Run_Unit_Test.yaml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: 02-Run Unit Test
on:
pull_request:
branches:
- 'main'
workflow_dispatch:
inputs:
branch:
description: 'Branch to test'
type: string
default: 'dev'
env:
REPO_URL: ${{ github.server_url }}/${{ github.repository }}
REPO_BRANCH: ${{ github.event.inputs.branch }}
REPO_NAME: ${{ github.repository }}
JLINK_PATH: /opt/SEGGER/JLink/libjlinkarm.so
SDK_PATH: $HOME/SimplicityStudio/SDKs/gecko_sdk
jobs:
job1:
name: Unit test for mg24 with gcc
runs-on: [self-hosted, ds-sqa-hn-iec]
permissions:
contents: read
pull-requests: write
env:
BOARD_NAME: brd4187c
HOST_IP: 192.168.1.69
COMPILER: GCC
TOOL_CHAINS: GCC
TASK: all
COMPONENTS: all
ADAPTER_SN: 440111030
CHIP: EFR32MG24BXXXF1536
TOOL_DIRS: $HOME/SimplicityStudio-5/SimplicityStudio_v5/developer/toolchains/gnu_arm/12.2.rel1_2023.7/bin
START_ADDR_FLASH: 0x8000000
steps:
- name: Trigger
run: echo "Triggered by ${{github.event_name}} event"
- name: Check Branch Input
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ -z "${{ github.event.inputs.branch }}" ]; then
echo "Branch input is required for manual trigger."
exit 1
else
echo "Checkout branch ${{ github.event.inputs.branch }}"
fi
else
# Extract branch name from github.ref
BRANCH_NAME="${{ github.ref }}"
BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/'
echo "Checkout branch $BRANCH_NAME"
fi
- name: Checkout
uses: actions/[email protected]
- name: Add extension
run: |
cd $SDK_PATH
cd extension
ls -la
git clone $REPO_URL
ls -la
cd $REPO_URL
git checkout $REPO_BRANCH
ls -la
- name: Run test
run: |
export PATH=$PATH:$HOME/SimplicityStudio-5/SimplicityStudio_v5/developer/adapter_packs/commander
export PATH=$PATH:$HOME/slc_cli
export PATH=$PATH:/usr/bin/
export PATH=$PATH:$HOME/amazon-corretto-17.0.12.7.1-linux-x64/bin
export LST_PATH=$PWD/build/test/integration_test/build/$BOARD_NAME/integration_test_iec60730_watchdog/S
slc configuration --sdk=${SDK_PATH}
ninja --version
slc signature trust --sdk $SDK_PATH
slc configuration -gcc=$TOOL_DIRS
make prepare
cd build
slc signature trust -extpath $SDK_PATH/extension/$REPO_NAME
cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_INTEGRATION_TESTING=ON -DBOARD_NAME=$BOARD_NAME
make unit_test_info -j4
cd ../test
mkdir log
echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER' > log/Test_integration_$BOARD_NAME_GCC_1.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CAL_CRC_32=ON"' > log/Test_integration_$BOARD_NAME_GCC_2.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CRC_USE_SW=ON"' > log/Test_integration_$BOARD_NAME_GCC_3.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CRC_USE_SW=ON -DENABLE_SW_CRC_TABLE=ON"' > log/Test_integration_$BOARD_NAME_GCC_4.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CRC_USE_SW=ON -DENABLE_SW_CRC_TABLE=ON -DENABLE_CAL_CRC_32=ON"' > log/Test_integration_$BOARD_NAME_GCC_5.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CRC_USE_SW=ON -DENABLE_CAL_CRC_32=ON"' > log/Test_integration_$BOARD_NAME_GCC_5.txt
- name: Upload artifact
uses: actions/[email protected]
with:
name: unit_test_log_mg24_gcc
path: test/log/
warn: Output a warning but do not fail the action
retention-days: 90
job2:
name: Unit test for mg12 with gcc
runs-on: [self-hosted, ds-sqa-hn-iec]
if: ${{ always() }}
needs: [job1]
permissions:
contents: read
pull-requests: write
env:
BOARD_NAME: brd4161a
HOST_IP: 192.168.1.69
COMPILER: GCC
TOOL_CHAINS: GCC
TASK: all
COMPONENTS: all
ADAPTER_SN: 440189400
CHIP: EFR32MG12
TOOL_DIRS: $HOME/SimplicityStudio-5/SimplicityStudio_v5/developer/toolchains/gnu_arm/12.2.rel1_2023.7/bin
START_ADDR_FLASH: 0x0000000
steps:
- name: Trigger
run: echo "Triggered by ${{github.event_name}} event"
- name: Check Branch Input
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ -z "${{ github.event.inputs.branch }}" ]; then
echo "Branch input is required for manual trigger."
exit 1
else
echo "Checkout branch ${{ github.event.inputs.branch }}"
fi
else
# Extract branch name from github.ref
BRANCH_NAME="${{ github.ref }}"
BRANCH_NAME="${BRANCH_NAME##*/}" # This removes everything before the last '/'
echo "Checkout branch $BRANCH_NAME"
fi
- name: Checkout
uses: actions/[email protected]
- name: Add extension
run: |
cd $SDK_PATH
cd extension
ls -la
git clone $REPO_URL
ls -la
cd $REPO_URL
git checkout $REPO_BRANCH
ls -la
- name: Prepare environment
run: |
export PATH=$PATH:$HOME/SimplicityStudio-5/SimplicityStudio_v5/developer/adapter_packs/commander
export PATH=$PATH:$HOME/slc_cli
export PATH=$PATH:/usr/bin/
export PATH=$PATH:$HOME/amazon-corretto-17.0.12.7.1-linux-x64/bin
export LST_PATH=$PWD/build/test/integration_test/build/$BOARD_NAME/integration_test_iec60730_watchdog/S
slc configuration --sdk=${SDK_PATH}
ninja --version
slc signature trust --sdk $SDK_PATH
slc configuration -gcc=$TOOL_DIRS
make prepare
cd build
slc signature trust -extpath $SDK_PATH/extension/$REPO_NAME
cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_INTEGRATION_TESTING=ON -DBOARD_NAME=$BOARD_NAME
make unit_test_info -j4
cd ../test
mkdir log
echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER' > log/Test_integration_$BOARD_NAME_GCC_1.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CAL_CRC_32=ON"' > log/Test_integration_$BOARD_NAME_GCC_2.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CRC_USE_SW=ON"' > log/Test_integration_$BOARD_NAME_GCC_3.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CRC_USE_SW=ON -DENABLE_SW_CRC_TABLE=ON"' > log/Test_integration_$BOARD_NAME_GCC_4.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CRC_USE_SW=ON -DENABLE_SW_CRC_TABLE=ON -DENABLE_CAL_CRC_32=ON"' > log/Test_integration_$BOARD_NAME_GCC_5.txt
#echo 'bash execute_unit_test.sh $BOARD_NAME $TASK $COMPONENTS $ADAPTER_SN $COMPILER "-DENABLE_CRC_USE_SW=ON -DENABLE_CAL_CRC_32=ON"' > log/Test_integration_$BOARD_NAME_GCC_5.txt
- name: Upload artifact
uses: actions/[email protected]
with:
name: unit_test_log_mg12_gcc
path: test/log/
warn: Output a warning but do not fail the action
retention-days: 90