Skip to content

Commit 4c03a9f

Browse files
authored
Merge pull request #1880 from hathach/reduce-selfed-host-iar
Bundle mulitple familes for self-hosted iar to reduce build time
2 parents d6354a2 + 1727702 commit 4c03a9f

File tree

8 files changed

+101
-114
lines changed

8 files changed

+101
-114
lines changed

.github/workflows/build_aarch64.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'examples/**'
88
- 'lib/**'
99
- 'hw/**'
10+
- '.github/workflows/build_aarch64.yml'
1011
pull_request:
1112
branches: [ master ]
1213
paths:
1314
- 'src/**'
1415
- 'examples/**'
1516
- 'lib/**'
1617
- 'hw/**'
18+
- '.github/workflows/build_aarch64.yml'
1719

1820
concurrency:
1921
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/build_arm.yml

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'examples/**'
88
- 'lib/**'
99
- 'hw/**'
10+
- '.github/workflows/build_arm.yml'
1011
pull_request:
1112
branches: [ master ]
1213
paths:
1314
- 'src/**'
1415
- 'examples/**'
1516
- 'lib/**'
1617
- 'hw/**'
18+
- '.github/workflows/build_arm.yml'
1719

1820
concurrency:
1921
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -98,20 +100,32 @@ jobs:
98100
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
99101
done
100102
101-
# Following steps are for Hardware Test with self-hosted
102-
103-
- name: Prepare Artifacts
103+
# Upload binaries for rp2040 hardware test with self-hosted
104+
- name: Prepare rp2040 Artifacts
104105
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
105106
run: find examples/ -name "*.elf" -exec mv {} . \;
106107

107-
- name: Upload Artifacts for Hardware Test
108+
- name: Upload rp2040 Artifacts
108109
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
109110
uses: actions/upload-artifact@v3
110111
with:
111112
name: ${{ matrix.family }}
112113
path: |
113114
*.elf
114115
116+
# Upload binaries for stm32l412nucleo hardware test with self-hosted
117+
- name: Prepare stm32l412nucleo Artifacts
118+
if: matrix.family == 'stm32l4'
119+
run: find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} . \;
120+
121+
- name: Upload stm32l412nucleo Artifacts
122+
if: matrix.family == 'stm32l4'
123+
uses: actions/upload-artifact@v3
124+
with:
125+
name: stm32l412nucleo
126+
path: |
127+
*.elf
128+
115129
# ---------------------------------------
116130
# Build all no-family (orphaned) boards
117131
# disable this workflow since it is often failed randomly
@@ -210,8 +224,67 @@ jobs:
210224
./flash.sh dfu_runtime.elf
211225
while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done
212226
213-
# - name: Test hid_boot_interface
214-
# run: |
215-
# ./flash.sh hid_boot_interface.elf
216-
# while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done
227+
# ---------------------------------------
228+
# Hardware in the loop (HIL)
229+
# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user
230+
# - STM32L412 Nucleo with on-board jlink as ttyACM0
231+
# ---------------------------------------
232+
hw-stm32l412nucleo-test:
233+
needs: build-arm
234+
runs-on: [self-hosted, Linux, X64, hifiphile]
235+
236+
steps:
237+
- name: Clean workspace
238+
run: |
239+
echo "Cleaning up previous run"
240+
rm -rf "${{ github.workspace }}"
241+
mkdir -p "${{ github.workspace }}"
242+
243+
- name: Download stm32l4 Artifacts
244+
uses: actions/download-artifact@v3
245+
with:
246+
name: stm32l412nucleo
247+
248+
- name: Create flash.sh
249+
run: |
250+
echo > flash.sh 'echo halt > flash.jlink'
251+
echo >> flash.sh 'echo r >> flash.jlink'
252+
echo >> flash.sh 'echo loadfile $1 >> flash.jlink'
253+
echo >> flash.sh 'echo r >> flash.jlink'
254+
echo >> flash.sh 'echo go >> flash.jlink'
255+
echo >> flash.sh 'echo exit >> flash.jlink'
256+
echo >> flash.sh 'cmdout=$(JLinkExe -device stm32l412kb -if swd -JTAGConf -1,-1 -speed auto -NoGui 1 -ExitOnError 1 -CommandFile flash.jlink)'
257+
echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
258+
chmod +x flash.sh
259+
260+
- name: Test cdc_dual_ports
261+
run: |
262+
./flash.sh cdc_dual_ports.elf
263+
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 5 ]; do :; done
264+
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
265+
test -e /dev/ttyACM2 && echo "ttyACM2 exists"
217266
267+
# Debian does not auto mount usb drive. skip this test for now
268+
- name: Test cdc_msc
269+
if: false
270+
run: |
271+
./flash.sh cdc_msc.elf
272+
readme='/media/pi/TinyUSB MSC/README.TXT'
273+
while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 5 ]; do :; done
274+
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
275+
test -f "$readme" && echo "$readme exists"
276+
cat "$readme"
277+
278+
- name: Test dfu
279+
run: |
280+
./flash.sh dfu.elf
281+
while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 5 ]; do :; done
282+
dfu-util -d cafe -a 0 -U dfu0
283+
dfu-util -d cafe -a 1 -U dfu1
284+
grep "TinyUSB DFU! - Partition 0" dfu0
285+
grep "TinyUSB DFU! - Partition 1" dfu1
286+
287+
- name: Test dfu_runtime
288+
run: |
289+
./flash.sh dfu_runtime.elf
290+
while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 5 ]; do :; done

.github/workflows/build_esp.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'examples/**'
88
- 'lib/**'
99
- 'hw/**'
10+
- '.github/workflows/build_esp.yml'
1011
pull_request:
1112
branches: [ master ]
1213
paths:
1314
- 'src/**'
1415
- 'examples/**'
1516
- 'lib/**'
1617
- 'hw/**'
18+
- '.github/workflows/build_esp.yml'
1719

1820
concurrency:
1921
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/build_iar.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'examples/**'
88
- 'lib/**'
99
- 'hw/**'
10+
- '.github/workflows/build_iar.yml'
1011
pull_request:
1112
branches: [ master ]
1213
paths:
1314
- 'src/**'
1415
- 'examples/**'
1516
- 'lib/**'
1617
- 'hw/**'
18+
- '.github/workflows/build_iar.yml'
1719

1820
concurrency:
1921
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -27,13 +29,9 @@ jobs:
2729
matrix:
2830
family:
2931
# Alphabetical order
30-
- 'stm32f0'
31-
- 'stm32f1'
32-
- 'stm32f4'
33-
- 'stm32f7'
34-
- 'stm32g4'
35-
- 'stm32h7'
36-
- 'stm32l4'
32+
# Note: bundle multiple families into a matrix since there is only one self-hosted instance can
33+
# run IAR build. Too many matrix can hurt due to setup/teardown overhead.
34+
- 'stm32f0 stm32f1 stm32f4 stm32f7 stm32g4 stm32h7 stm32l4'
3735
steps:
3836
- name: Clean workspace
3937
run: |
@@ -49,11 +47,11 @@ jobs:
4947
git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
5048
python3 tools/get_dependencies.py ${{ matrix.family }}
5149
52-
- name: Checkout pico-sdk for rp2040
53-
if: matrix.family == 'rp2040'
54-
run: |
55-
git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
56-
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
50+
#- name: Checkout pico-sdk for rp2040
51+
# if: matrix.family == 'rp2040'
52+
# run: |
53+
# git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
54+
# echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
5755

5856
- name: Build
5957
run: python3 tools/build_family.py ${{ matrix.family }} CC=iccarm

.github/workflows/build_msp430.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'examples/**'
88
- 'lib/**'
99
- 'hw/**'
10+
- '.github/workflows/build_msp430.yml'
1011
pull_request:
1112
branches: [ master ]
1213
paths:
1314
- 'src/**'
1415
- 'examples/**'
1516
- 'lib/**'
1617
- 'hw/**'
18+
- '.github/workflows/build_msp430.yml'
1719

1820
concurrency:
1921
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/build_renesas.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'examples/**'
88
- 'lib/**'
99
- 'hw/**'
10+
- '.github/workflows/build_renesas.yml'
1011
pull_request:
1112
branches: [ master ]
1213
paths:
1314
- 'src/**'
1415
- 'examples/**'
1516
- 'lib/**'
1617
- 'hw/**'
18+
- '.github/workflows/build_renesas.yml'
1719

1820
concurrency:
1921
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/build_riscv.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
- 'examples/**'
88
- 'lib/**'
99
- 'hw/**'
10+
- '.github/workflows/build_riscv.yml'
1011
pull_request:
1112
branches: [ master ]
1213
paths:
1314
- 'src/**'
1415
- 'examples/**'
1516
- 'lib/**'
1617
- 'hw/**'
18+
- '.github/workflows/build_riscv.yml'
1719

1820
concurrency:
1921
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

.github/workflows/test_hardware.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)