Skip to content

Commit e6c55e3

Browse files
authored
[action/manual_trigger] fix mannual trigger to create dist zip file
修复手动生成编译的error
1 parent 301fce1 commit e6c55e3

12 files changed

+49
-240
lines changed

.github/workflows/action_runner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
runs-on: [self-hosted, windows, x64]
4040
name: ${{ github.event.inputs.bsp_options }}
4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@main
4343
- name: Bsp Scons Compile
4444
if: ${{ success() }}
4545
env:

.github/workflows/action_tools.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
env:
4343
TEST_BSP_ROOT: bsp/stm32/stm32f407-atk-explorer
4444
steps:
45-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@main
4646

4747
- name: Install Tools
4848
shell: bash

.github/workflows/action_utest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
TEST_CONFIG_FILE: ${{ matrix.legs.CONFIG_FILE }}
5757
TEST_SD_FILE: ${{ matrix.legs.SD_FILE }}
5858
steps:
59-
- uses: actions/checkout@v4
59+
- uses: actions/checkout@main
6060

6161
- name: Install Tools
6262
shell: bash

.github/workflows/bsp_buildings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
filtered_matrix: ${{ steps.filter.outputs.filtered_matrix }}
4646
steps:
4747
- name: Checkout repo
48-
uses: actions/checkout@v4
48+
uses: actions/checkout@main
4949
with:
5050
sparse-checkout: .github/ALL_BSP_COMPILE.json
5151
persist-credentials: false
@@ -111,7 +111,7 @@ jobs:
111111
fail-fast: false
112112
matrix: ${{ fromJson(needs.generate-matrix.outputs.filtered_matrix) }}
113113
steps:
114-
- uses: actions/checkout@v4
114+
- uses: actions/checkout@main
115115
- name: Set up Python
116116
uses: actions/setup-python@main
117117
with:

.github/workflows/compile_bsp_with_drivers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
name: BSP Compilation with More Drivers
2525

2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@main
2828
- name: Set up Python
2929
uses: actions/setup-python@v3
3030
with:

.github/workflows/manual_bsp_build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ jobs:
5454
runs-on: ubuntu-22.04
5555
name: ${{ github.event.inputs.bsp_options }}
5656
steps:
57-
- uses: actions/checkout@v4
57+
- uses: actions/checkout@main
5858
- name: Set up Python
59-
uses: actions/setup-python@v3
59+
uses: actions/setup-python@main
6060
with:
6161
python-version: 3.8
6262

.github/workflows/manual_dist.yml

Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Date Author Notes
88
# 2023-07-01 Supperthomas the first version
99
# 2024-09-06 Supperthomas add debug for action and add cppcheck for project
10+
# 2024-09-06 Supperthomas 优化toolchain安装方式,解决手动触发出现的异常,优化流程结构
1011
#
1112
name: manual_scons_dist_trigger_only_one
1213

@@ -53,86 +54,73 @@ jobs:
5354
runs-on: ubuntu-22.04
5455
name: ${{ github.event.inputs.bsp_options }}
5556
steps:
56-
- uses: actions/checkout@v4
57+
- uses: actions/checkout@main
5758
- name: Set up Python
58-
uses: actions/setup-python@v3
59+
uses: actions/setup-python@main
5960
with:
6061
python-version: 3.8
6162

6263
- name: Install Tools
6364
shell: bash
6465
run: |
65-
sudo apt-get update
6666
wget https://raw.githubusercontent.com/RT-Thread/env/master/install_ubuntu.sh
6767
chmod 777 install_ubuntu.sh
6868
./install_ubuntu.sh
69+
pip install -r tools/requirements.txt
6970
git config --global http.postBuffer 524288000
7071
echo "RTT_ROOT=${{ github.workspace }}" >> $GITHUB_ENV
7172
echo "RTT_CC=gcc" >> $GITHUB_ENV
73+
echo "export PATH=~/.env/tools/scripts:$PATH" > ~/.env/env.sh
7274
sudo apt-get -qq install cppcheck
7375
74-
- name: Install Arm ToolChains
76+
- name: Install ToolChains
7577
if: ${{ github.event.inputs.bsp_tool_chain == 'sourcery-arm' && success() }}
7678
shell: bash
7779
run: |
78-
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
79-
sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt
80-
/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version
81-
echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV
80+
source tools/ci/toolchain.sh arm-none-eabi-gcc
81+
echo "RTT_EXEC_PATH=/opt/arm-none-eabi-gcc/bin" >> $GITHUB_ENV
8282
8383
- name: Install LLVM-Arm ToolChains
8484
if: ${{ github.event.inputs.bsp_tool_chain == 'llvm-arm' && success() }}
8585
shell: bash
8686
run: |
87-
wget -q https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-16.0.0/LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64.tar.gz
88-
sudo tar zxf LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64.tar.gz -C /opt
89-
sudo apt-get -qq install libncurses5 libncurses5-dev libncursesw5-dev
90-
/opt/LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64/bin/clang --version
87+
source tools/ci/toolchain.sh clang
88+
echo "RTT_EXEC_PATH=/opt/clang/bin" >> $GITHUB_ENV
9189
echo "RTT_CC=llvm-arm" >> $GITHUB_ENV
92-
echo "RTT_EXEC_PATH=/opt/LLVMEmbeddedToolchainForArm-16.0.0-Linux-x86_64/bin" >> $GITHUB_ENV
9390
9491
- name: Install AArch64 ToolChains
9592
if: ${{ github.event.inputs.bsp_tool_chain == 'sourcery-aarch64' && success() }}
9693
shell: bash
9794
run: |
98-
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.6/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz
99-
sudo tar -xf gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz -C /opt
100-
/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc --version
101-
echo "RTT_EXEC_PATH=/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin" >> $GITHUB_ENV
95+
source tools/ci/toolchain.sh aarch64-none-elf-gcc
96+
echo "RTT_EXEC_PATH=/opt/aarch64-none-elf-gcc/bin" >> $GITHUB_ENV
10297
10398
- name: Install Mips ToolChains
10499
if: ${{ github.event.inputs.bsp_tool_chain == 'sourcery-mips' && success() }}
105100
shell: bash
106101
run: |
107-
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.1/mips-2016.05-7-mips-sde-elf-i686-pc-linux-gnu.tar.bz2
108-
sudo tar xjf mips-2016.05-7-mips-sde-elf-i686-pc-linux-gnu.tar.bz2 -C /opt
109-
/opt/mips-2016.05/bin/mips-sde-elf-gcc --version
110-
echo "RTT_EXEC_PATH=/opt/mips-2016.05/bin" >> $GITHUB_ENV
102+
source tools/ci/toolchain.sh mips-sde-elf-gcc
103+
echo "RTT_EXEC_PATH=/opt/mips-sde-elf-gcc/bin" >> $GITHUB_ENV
111104
112105
- name: Install Riscv64-unknown-elf ToolChains
113106
if: ${{ github.event.inputs.bsp_tool_chain == 'sourcery-riscv64-unknown-elf' && success() }}
114107
run: |
115-
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.4/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
116-
sudo tar zxf riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz -C /opt
117-
/opt/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin/riscv64-unknown-elf-gcc --version
118-
echo "RTT_EXEC_PATH=/opt/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin" >> $GITHUB_ENV
108+
source tools/ci/toolchain.sh riscv64-unknown-elf-gcc
109+
echo "RTT_EXEC_PATH=/opt/riscv64-unknown-elf-gcc/bin" >> $GITHUB_ENV
119110
120111
- name: Install Riscv-none-embed ToolChains
121112
if: ${{ github.event.inputs.bsp_tool_chain == 'sourcery-riscv-none-embed' && success() }}
122113
run: |
123-
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.5/xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-x64.tar.gz
124-
sudo tar zxf xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-x64.tar.gz -C /opt
125-
/opt/xpack-riscv-none-embed-gcc-8.3.0-2.3/bin/riscv-none-embed-gcc --version
126-
echo "RTT_EXEC_PATH=/opt/xpack-riscv-none-embed-gcc-8.3.0-2.3/bin" >> $GITHUB_ENV
114+
source tools/ci/toolchain.sh riscv-none-embed-gcc
115+
echo "RTT_EXEC_PATH=/opt/riscv-none-embed-gcc/bin" >> $GITHUB_ENV
116+
127117
128118
- name: Install riscv32-esp-elf ToolChains
129119
if: ${{ github.event.inputs.bsp_tool_chain == 'sourcery-riscv32-esp32' && success() }}
130120
run: |
131-
wget -q https://github.com/espressif/crosstool-NG/releases/download/esp-2022r1-RC1/riscv32-esp-elf-gcc11_2_0-esp-2022r1-RC1-linux-amd64.tar.xz
132-
sudo tar xf riscv32-esp-elf-gcc11_2_0-esp-2022r1-RC1-linux-amd64.tar.xz -C /opt
133-
/opt/riscv32-esp-elf/bin/riscv32-esp-elf-gcc --version
121+
source tools/ci/toolchain.sh riscv32-esp-elf-gcc
122+
echo "RTT_EXEC_PATH=/opt/riscv32-esp-elf-gcc/bin" >> $GITHUB_ENV
134123
pip3 install esptool
135-
echo "RTT_EXEC_PATH=/opt/riscv32-esp-elf/bin" >> $GITHUB_ENV
136124
137125
- name: Install GCC Tools
138126
if: ${{ github.event.inputs.bsp_tool_chain == 'gcc' && success() }}
@@ -152,19 +140,23 @@ jobs:
152140
config=${{ github.event.inputs.bsp_config}}
153141
echo "$config"
154142
echo "$config" >> bsp/$RTT_BSP/.config
155-
insert_code="env.Tool('compilation_db')\nenv.CompilationDatabase()\n"
156-
sed -i "/DoBuilding(TARGET, objs)/i $insert_code" bsp/$RTT_BSP/SConstruct
157143
scons -C bsp/$RTT_BSP --pyconfig-silent
158144
pushd bsp/$RTT_BSP && pkgs --update && popd
159145
cat bsp/$RTT_BSP/.config
160-
scons -C bsp/$RTT_BSP -j$(nproc)
146+
scons -C bsp/$RTT_BSP -j$(nproc) --cdb
161147
ls bsp/$RTT_BSP
162-
cppcheck --project=bsp/$RTT_BSP/compile_commands.json
163-
pwd
148+
scons --dist -C bsp/$RTT_BSP
149+
mv bsp/$RTT_BSP/dist .
150+
cppcheck --project=bsp/$RTT_BSP/build/compile_commands.json
164151
165-
- uses: actions/upload-artifact@v3
166-
if: ${{ github.event.inputs.dist_flag }}
152+
- uses: actions/upload-artifact@main
153+
if: ${{ github.event.inputs.dist_flag && success()}}
167154
with:
168-
name: dist_file
169-
path: ${{ github.workspace }}/${{ github.event.inputs.bsp_options }}/*
170-
155+
name: rtt_dist_bsp
156+
path: ${{ github.workspace }}/dist/*.zip
157+
158+
- uses: actions/upload-artifact@main
159+
if: ${{ github.event.inputs.dist_flag && success()}}
160+
with:
161+
name: rtt_bsp_fold
162+
path: ${{ github.workspace }}/bsp/${{ github.event.inputs.bsp_options }}/*

0 commit comments

Comments
 (0)