-
Notifications
You must be signed in to change notification settings - Fork 1
211 lines (208 loc) · 7.24 KB
/
01-Generate_Firmware.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: 01-Generate Firmware
on:
push:
branches-ignore:
- main
- "tests/**"
pull_request:
branches:
- 'main'
- 'release/**'
workflow_dispatch:
inputs:
branch:
description: 'Branch to test'
type: string
default: 'dev'
ADAPTER_SN_MG12:
description: 'Adapter serial number of MG12'
type: string
default: '440189400'
ADAPTER_SN_MG24:
description: 'Adapter serial number of MG24'
type: string
default: '440133193'
env:
AM_CORRETTO_17: https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz
SLC_CLI_URL: https://www.silabs.com/documents/login/software/slc_cli_linux.zip
COMMANDER_URL: https://www.silabs.com/documents/login/software/SimplicityCommander-Linux.zip
GCC_URL: https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
SIM_REPO: https://github.com/SiliconLabs/simplicity_sdk.git
GECKO_SDK_REPO: https://github.com/SiliconLabs/gecko_sdk.git
SDK_VER: v4.4.2
JLINK_SEGGER_URL: https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.tgz
SDK_PATH: /home/sqa/SimplicityStudio/SDKs/gecko_sdk
START_ADDR_FLASH: 0x8000000
TASK: gen-only
jobs:
job1:
name: Generate Firmware for MG24 with GCC
runs-on: ubuntu-20.04
permissions:
contents: read
pull-requests: write
env:
BOARD_NAME_MG12: brd4161a
BOARD_NAME_MG24: brd4187c
ADAPTER_SN_MG12: ${{ github.event.inputs.ADAPTER_SN_MG12 }} #440189400
ADAPTER_SN_MG24: ${{ github.event.inputs.ADAPTER_SN_MG24 }} #440133193
HOST_IP: 192.168.1.69
TOOL_DIRS: arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin
COMPILER: GCC
TOOL_CHAINS: GCC
TASK: gen-only
COMPONENT: all
CHIP_MG12: EFR32MG12
CHIP_MG24: EFR32MG24BXXXF1536
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
fi
fi
- name: Checkout
uses: actions/[email protected]
with:
ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}"
- name: Log Current Branch and Commit
run: |
echo "Current branch: $(git rev-parse --abbrev-ref HEAD)"
echo "Current commit: $(git rev-parse HEAD)"
- name: Install Simplicity SDK
if: always()
run: |
if [ -d "simplicity_sdk" ]; then
echo "Removing existing simplicity_sdk folder..."
rm -rf simplicity_sdk
fi
git clone $SIM_REPO
cd simplicity_sdk || exit
ls -la
cd ..
ls -la
- name: Install Gecko SDK
if: always()
run: |
if [ -d "gecko_sdk_$SDK_VER" ]; then
echo "Removing existing gecko_sdk_$SDK_VER folder..."
rm -rf gecko_sdk_$SDK_VER
fi
echo "Cloning the repository..."
git clone $GECKO_SDK_REPO gecko_sdk_$SDK_VER
cd gecko_sdk_$SDK_VER || exit
git checkout tags/$SDK_VER
ls -la
mkdir extension
cd extension
git clone https://github.com/SiliconLabs/IEC60730_Libs.git
cd IEC60730_Libs
git checkout create-unit-test-functions-in-lib-iec60730
ls -la
cd ..
ls -la
cd ..
ls -la
- name: Install Amazon Corretto 17
if: always()
run: |
wget $AM_CORRETTO_17
tar -xzf amazon-corretto-17-x64-linux-jdk.tar.gz
ls -la
- name: Install SLC CLI
if: always()
run: |
wget $SLC_CLI_URL
unzip slc_cli_linux.zip
ls -la
- name: Install Simplicity Commander
if: always()
run: |
wget $COMMANDER_URL
unzip SimplicityCommander-Linux.zip
cd SimplicityCommander-Linux
ls -la
cd ..
mkdir commander
tar -xf SimplicityCommander-Linux/Commander_linux_x86_64_*.tar.bz commander
cd commander
ls -la
- name: Install GCC
if: always()
run: |
wget $GCC_URL
tar -xf arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
ls -la
cd arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi
ls -la
- name: Install Ninja build
run: |
sudo apt update
sudo apt -y install ninja-build
ninja --version
- name: Install python3.11
if: always()
run: |
sudo apt update
sudo apt upgrade
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update
sudo apt install python3.11
python3.11 --version
which python3.11
cat ~/.bashrc
echo "alias python3=python3.11" >> ~/.bashrc
echo "alias python3=python3.11" >> ~/.bash_profile
cat ~/.bashrc
source ~/.bash_profile
source ~/.bashrc
python3 --version
sudo apt install python3.11-full
sudo apt install python3-pip
- name: Generate image
run: |
export PATH=$PATH:$PWD/commander
export PATH=$PATH:$PWD/slc_cli
export JLINK_PATH=/opt/SEGGER/JLink/libjlinkarm.so
export TOOL_DIRS=$PWD/$TOOL_DIRS
export PATH=$PATH:/usr/bin/
export SDK_PATH=$PWD/gecko_sdk_$SDK_VER
export PATH=$PATH:$PWD/amazon-corretto-17.0.12.7.1-linux-x64/bin
echo $PATH
echo 2 | sudo update-alternatives --config java || exit 1
java --version
slc --version
slc configuration --sdk=${SDK_PATH}
ninja --version
slc signature trust --sdk $SDK_PATH
slc configuration -gcc=$TOOL_DIRS
make prepare
cd build || exit 1
echo "Generate image for MG12"
slc signature trust -extpath $SDK_PATH/extension/IEC60730_Libs
cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_INTEGRATION_TESTING=ON -DBOARD_NAME=$BOARD_NAME_MG12 || exit 1
cmake --build . --target integration_test_info -j4 || exit 1
export JLINK_PATH=/opt/SEGGER/JLink/libjlinkarm.so
export HOST_IP=$HOST_IP
bash execute_integration_test.sh $BOARD_NAME_MG12 $TASK $COMPONENTS $ADAPTER_SN_MG12 $COMPILER || exit 1
echo "Generate image for MG24"
cmake --toolchain ../cmake/toolchain.cmake .. -DENABLE_INTEGRATION_TESTING=ON -DBOARD_NAME=$BOARD_NAME_MG24 || exit 1
bash execute_integration_test.sh $BOARD_NAME_MG24 $TASK $COMPONENTS $ADAPTER_SN_MG24 $COMPILER || exit 1
- name: Upload firmware MG12
uses: actions/[email protected]
with:
name: firmware_mg12_gcc
path: ${{ github.workspace }}/build/test/integration_test/build/$BOARD_NAME_MG12/
warn: Output a warning but do not fail the action
retention-days: 90
- name: Upload firmware MG24
uses: actions/[email protected]
with:
name: firmware_mg24_gcc
path: ${{ github.workspace }}/build/test/integration_test/build/$BOARD_NAME_MG24/
warn: Output a warning but do not fail the action
retention-days: 90