-
Notifications
You must be signed in to change notification settings - Fork 45
153 lines (147 loc) · 5.81 KB
/
action.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
141
142
143
144
145
146
147
148
149
150
151
152
153
name: dlt645
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
# Runs at 16:00 UTC (BeiJing 00:00) on the 1st of every month
schedule:
- cron: '0 16 1 * *'
push:
branches:
- master
paths-ignore:
- documentation/**
- '**/README.md'
- '**/README_zh.md'
pull_request:
branches:
- master
paths-ignore:
- documentation/**
- '**/README.md'
- '**/README_zh.md'
jobs:
build:
runs-on: ubuntu-latest
name: ${{ matrix.legs.RTT_BSP }}
strategy:
fail-fast: false
matrix:
legs:
- RTT_BSP: "gd32"
RTT_TOOL_CHAIN: "sourcery-arm"
SUB_RTT_BSP:
- "gd32/arm/gd32103c-eval"
- "gd32/arm/gd32105c-eval"
- "gd32/arm/gd32105r-start"
- "gd32/arm/gd32107c-eval"
- "gd32/arm/gd32205r-start"
- "gd32/arm/gd32207i-eval"
- "gd32/arm/gd32303e-eval"
- "gd32/arm/gd32305r-start"
- "gd32/arm/gd32307e-start"
- "gd32/arm/gd32407v-start"
- "gd32/arm/gd32450z-eval"
- RTT_BSP: "stm32"
RTT_TOOL_CHAIN: "sourcery-arm"
SUB_RTT_BSP:
- "stm32/stm32f072-st-nucleo"
- "stm32/stm32f091-st-nucleo"
- "stm32/stm32f107-uc-eval"
- "stm32/stm32f207-st-nucleo"
- "stm32/stm32f401-st-nucleo"
- "stm32/stm32f405-smdz-breadfruit"
- "stm32/stm32f407-armfly-v5"
- "stm32/stm32f410-st-nucleo"
- "stm32/stm32f411-atk-nano"
- "stm32/stm32f412-st-nucleo"
- "stm32/stm32f413-st-nucleo"
- "stm32/stm32f427-robomaster-a"
- "stm32/stm32f429-armfly-v6"
- "stm32/stm32f446-st-nucleo"
- "stm32/stm32f469-st-disco"
- "stm32/stm32f746-st-disco"
- "stm32/stm32f767-atk-apollo"
- "stm32/stm32f769-st-disco"
- "stm32/stm32g070-st-nucleo"
- "stm32/stm32g071-st-nucleo"
- "stm32/stm32g431-st-nucleo"
- "stm32/stm32g474-st-nucleo"
- "stm32/stm32h743-armfly-v7"
- "stm32/stm32h747-st-discovery"
- "stm32/stm32h750-artpi"
- "stm32/stm32l4r5-st-nucleo"
- "stm32/stm32l4r9-st-eval"
- "stm32/stm32l010-st-nucleo"
- "stm32/stm32l412-st-nucleo"
- "stm32/stm32l431-BearPi"
- "stm32/stm32l432-st-nucleo"
- "stm32/stm32l433-ali-startkit"
- "stm32/stm32l452-st-nucleo"
- "stm32/stm32l475-atk-pandora"
- "stm32/stm32l476-st-nucleo"
- "stm32/stm32l496-ali-developer"
- "stm32/stm32l552-st-nucleo"
- "stm32/stm32mp157a-st-discovery"
- "stm32/stm32u575-st-nucleo"
- "stm32/stm32wb55-st-nucleo"
steps:
- uses: actions/checkout@v3
with:
repository: RT-Thread/rt-thread
- uses: actions/checkout@v3
with:
path: mypkgs/dlt645
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install Tools
shell: bash
run: |
sudo apt-get update
sudo apt-get -qq install gcc-multilib libncurses5-dev scons
sudo python -m pip install --upgrade pip -qq
pip install requests -qq
pip install psutil
git config --global http.postBuffer 524288000
python -c "import tools.menuconfig; tools.menuconfig.touch_env()"
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
echo "RTT_CC=gcc" >> $GITHUB_ENV
- name: Install Arm ToolChains
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-arm' && success() }}
shell: bash
run: |
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.3/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt
/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version
echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV
- name: Bsp Scons Compile
if: ${{ success() }}
shell: bash
env:
RTT_BSP: ${{ matrix.legs.RTT_BSP }}
RTT_TOOL_CHAIN: ${{ matrix.legs.RTT_TOOL_CHAIN }}
SRTT_BSP: ${{ join(matrix.legs.SUB_RTT_BSP, ',') }}
run: |
source ~/.env/env.sh
failed=0
count=0
for bsp in $(echo $SRTT_BSP | tr ',' '\n'); do
count=$((count+1))
echo "::group::Compiling BSP: ==$count=== $bsp ===="
echo bsp/$bsp
sed -i "s/# CONFIG_PKG_USING_DLT645 is not set/CONFIG_PKG_USING_DLT645=y/g" bsp/$bsp/.config
scons --pyconfig-silent -C bsp/$bsp
sed -i "s/# CONFIG_DLT645_USING_SAMPLE is not set/CONFIG_DLT645_USING_SAMPLE=y/g" bsp/$bsp/.config
scons --pyconfig-silent -C bsp/$bsp
pushd bsp/$bsp && pkgs --update && popd
rm -r bsp/$bsp/packages/dlt645-latest
cp -r mypkgs/dlt645 bsp/$bsp/packages/dlt645
scons -C bsp/$bsp -j$(nproc) --debug=time | tee output.log || \
{ total_time=$(grep "Total command execution time" output.log | awk '{print $5}'); \
failed=$((failed+1)) ; echo "::endgroup::" ; echo "::error::build $bsp failed" ; \
echo "- ❌ build $bsp failed in $total_time seconds " >> $GITHUB_STEP_SUMMARY ; } && \
{ total_time=$(grep "Total command execution time" output.log | awk '{print $5}'); \
echo "- ✅ build $bsp success in $total_time seconds " >> $GITHUB_STEP_SUMMARY ; echo "::endgroup::" ; }
done
exit $failed