Skip to content

Commit 9e0ae5f

Browse files
committed
improve ci
1 parent 3387c86 commit 9e0ae5f

File tree

3 files changed

+20
-31
lines changed

3 files changed

+20
-31
lines changed

.github/workflows/build_arm.yml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ jobs:
3434
# Alphabetical order
3535
- 'broadcom_32bit'
3636
- 'imxrt'
37-
- 'lpc15'
38-
- 'lpc18'
39-
- 'lpc54'
40-
- 'lpc55'
37+
- 'lpc15 lpc18'
38+
- 'lpc54 lpc55'
4139
- 'mm32'
4240
- 'msp432e4'
4341
- 'nrf'
@@ -46,14 +44,12 @@ jobs:
4644
- 'samd21'
4745
- 'samd51'
4846
- 'saml2x'
49-
- 'stm32f0'
50-
- 'stm32f1'
47+
- 'stm32f0 stm32f1'
5148
- 'stm32f4'
5249
- 'stm32f7'
53-
- 'stm32g4'
50+
- 'stm32g4 stm32wb'
5451
- 'stm32h7'
5552
- 'stm32l4'
56-
- 'stm32wb'
5753
- 'tm4c123'
5854
- 'xmc4000'
5955
steps:
@@ -71,7 +67,7 @@ jobs:
7167
uses: actions/checkout@v3
7268

7369
- name: Checkout common submodules in lib
74-
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
70+
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
7571

7672
- name: Checkout hathach/linkermap
7773
uses: actions/checkout@v3
@@ -100,29 +96,21 @@ jobs:
10096
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
10197
done
10298
103-
# Upload binaries for rp2040 hardware test with self-hosted
99+
# Upload binaries for rp2040/stm32l412nucleo hardware test with self-hosted
100+
104101
- name: Prepare rp2040 Artifacts
105102
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
106103
run: find examples/ -name "*.elf" -exec mv {} . \;
107104

108-
- name: Upload rp2040 Artifacts
109-
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
110-
uses: actions/upload-artifact@v3
111-
with:
112-
name: ${{ matrix.family }}
113-
path: |
114-
*.elf
115-
116-
# Upload binaries for stm32l412nucleo hardware test with self-hosted
117105
- name: Prepare stm32l412nucleo Artifacts
118106
if: matrix.family == 'stm32l4'
119107
run: find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} . \;
120108

121-
- name: Upload stm32l412nucleo Artifacts
122-
if: matrix.family == 'stm32l4'
109+
- name: Upload Artifacts for hardware testing
110+
if: matrix.family == 'stm32l4' || (matrix.family == 'rp2040' && github.repository_owner == 'hathach')
123111
uses: actions/upload-artifact@v3
124112
with:
125-
name: stm32l412nucleo
113+
name: ${{ matrix.family }}
126114
path: |
127115
*.elf
128116
@@ -244,7 +232,7 @@ jobs:
244232
- name: Download stm32l4 Artifacts
245233
uses: actions/download-artifact@v3
246234
with:
247-
name: stm32l412nucleo
235+
name: stm32l4
248236

249237
- name: Create flash.sh
250238
run: |

examples/rules.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ get-deps:
196196
git -C $(TOP) submodule update --init $(DEPS_SUBMODULES)
197197
endif
198198

199+
.PHONY: size
199200
size: $(BUILD)/$(PROJECT).elf
200201
-@echo ''
201202
@$(SIZE) $<

tools/build_utils.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,22 @@ def build_example(example, board, make_option):
8585
# succeeded, failed, skipped
8686
ret = [0, 0, 0]
8787

88+
make_cmd = "make -j -C examples/{} BOARD={} {}".format(example, board, make_option)
89+
8890
# Check if board is skipped
8991
if skip_example(example, board):
9092
status = SKIPPED
9193
ret[2] = 1
9294
print(build_format.format(example, board, status, '-', flash_size, sram_size))
9395
else:
94-
build_result = subprocess.run("make -j -C examples/{} BOARD={} {} all".format(example, board, make_option), shell=True,
95-
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
96+
subprocess.run(make_cmd + " clean", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
97+
build_result = subprocess.run(make_cmd + " all", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
9698

9799
if build_result.returncode == 0:
98100
status = SUCCEEDED
99101
ret[0] = 1
100-
(flash_size, sram_size) = build_size(example, board)
101-
subprocess.run("make -j -C examples/{} BOARD={} {} copy-artifact".format(example, board, make_option), shell=True,
102-
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
102+
(flash_size, sram_size) = build_size(make_cmd)
103+
#subprocess.run(make_cmd + " copy-artifact", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
103104
else:
104105
status = FAILED
105106
ret[1] = 1
@@ -113,9 +114,8 @@ def build_example(example, board, make_option):
113114
return ret
114115

115116

116-
def build_size(example, board):
117-
size_cmd = 'make -j -C examples/{} BOARD={} size'.format(example, board)
118-
size_output = subprocess.run(size_cmd, shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8").splitlines()
117+
def build_size(make_cmd):
118+
size_output = subprocess.run(make_cmd + ' size', shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8").splitlines()
119119
for i, l in enumerate(size_output):
120120
text_title = 'text data bss dec'
121121
if text_title in l:

0 commit comments

Comments
 (0)