-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (161 loc) · 4.69 KB
/
Copy pathbuild.yml
File metadata and controls
185 lines (161 loc) · 4.69 KB
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
name: Build
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
build-gcc:
name: Build with ARM GCC
runs-on: ubuntu-latest
strategy:
matrix:
config:
- name: "Default (All OFF)"
freertos: "OFF"
lvgl: "OFF"
- name: "FreeRTOS ON"
freertos: "ON"
lvgl: "OFF"
- name: "LVGL ON"
freertos: "OFF"
lvgl: "ON"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Install ARM GCC Toolchain
run: |
sudo apt-get install -y gcc-arm-none-eabi
- name: Verify toolchain installation
run: |
arm-none-eabi-gcc --version
ninja --version
cmake --version
- name: Build with GCC - ${{ matrix.config.name }}
run: |
cmake -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE="cmake/gcc-arm-none-eabi.cmake" \
-DCMAKE_BUILD_TYPE=Debug \
-DMCU_MODEL="STM32F429ZIT6_GCC" \
-DUSE_FREERTOS=${{ matrix.config.freertos }} \
-DUSE_FATFS=OFF \
-DUSE_LVGL=${{ matrix.config.lvgl }}
ninja -C build
build-gcc-windows:
name: Build with ARM GCC (Windows)
runs-on: windows-latest
strategy:
matrix:
config:
- name: "Default (All OFF)"
freertos: "OFF"
lvgl: "OFF"
- name: "FreeRTOS ON"
freertos: "ON"
lvgl: "OFF"
- name: "LVGL ON"
freertos: "OFF"
lvgl: "ON"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Install ARM GCC Toolchain
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '13.2.Rel1'
- name: Verify toolchain installation
shell: pwsh
run: |
arm-none-eabi-gcc --version
ninja --version
cmake --version
- name: Build with GCC - ${{ matrix.config.name }}
shell: pwsh
run: |
cmake -B build -G Ninja `
-DCMAKE_TOOLCHAIN_FILE="cmake/gcc-arm-none-eabi.cmake" `
-DCMAKE_BUILD_TYPE=Debug `
-DMCU_MODEL="STM32F429ZIT6_GCC" `
-DUSE_FREERTOS=${{ matrix.config.freertos }} `
-DUSE_FATFS=OFF `
-DUSE_LVGL=${{ matrix.config.lvgl }}
ninja -C build
test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build gcc-multilib g++-multilib
- name: Verify tools installation
run: |
ninja --version
cmake --version
gcc --version
- name: Run tests
run: |
cd Test
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-m32" \
-DCMAKE_CXX_FLAGS="-m32"
cmake --build build --config Debug
# 运行测试可执行文件
if [ -f "build/test" ]; then
echo "Running test executable..."
./build/test
else
echo "Error: Test executable not found at build/test"
ls -la build/
exit 1
fi
test-windows:
name: Run Unit Tests (Windows)
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Setup MSYS2 with GCC
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
- name: Verify tools installation
shell: msys2 {0}
run: |
gcc --version
cmake --version
ninja --version
- name: Run tests
shell: msys2 {0}
run: |
cd Test
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
# 运行测试可执行文件
if [ -f "build/test.exe" ]; then
echo "Running test executable..."
./build/test.exe
else
echo "Error: Test executable not found at build/test.exe"
ls -la build/
exit 1
fi