Skip to content

Commit be66f5f

Browse files
authored
Merge pull request hathach#1941 from hathach/minor-ci
Minor ci
2 parents 3387c86 + 0957902 commit be66f5f

File tree

3 files changed

+22
-35
lines changed

3 files changed

+22
-35
lines changed

.github/workflows/build_arm.yml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,22 @@ jobs:
3434
# Alphabetical order
3535
- 'broadcom_32bit'
3636
- 'imxrt'
37-
- 'lpc15'
38-
- 'lpc18'
39-
- 'lpc54'
40-
- 'lpc55'
41-
- 'mm32'
42-
- 'msp432e4'
37+
- 'lpc15 lpc18'
38+
- 'lpc54 lpc55'
39+
- 'mm32 msp432e4'
4340
- 'nrf'
4441
- 'rp2040'
4542
- 'samd11'
4643
- 'samd21'
4744
- 'samd51'
4845
- 'saml2x'
49-
- 'stm32f0'
50-
- 'stm32f1'
46+
- 'stm32f0 stm32f1'
5147
- 'stm32f4'
5248
- 'stm32f7'
53-
- 'stm32g4'
49+
- 'stm32g4 stm32wb'
5450
- 'stm32h7'
5551
- 'stm32l4'
56-
- 'stm32wb'
57-
- 'tm4c123'
58-
- 'xmc4000'
52+
- 'tm4c123 xmc4000'
5953
steps:
6054
- name: Setup Python
6155
uses: actions/setup-python@v4
@@ -71,7 +65,7 @@ jobs:
7165
uses: actions/checkout@v3
7266

7367
- name: Checkout common submodules in lib
74-
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
68+
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
7569

7670
- name: Checkout hathach/linkermap
7771
uses: actions/checkout@v3
@@ -100,29 +94,21 @@ jobs:
10094
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
10195
done
10296
103-
# Upload binaries for rp2040 hardware test with self-hosted
97+
# Upload binaries for rp2040/stm32l412nucleo hardware test with self-hosted
98+
10499
- name: Prepare rp2040 Artifacts
105100
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
106101
run: find examples/ -name "*.elf" -exec mv {} . \;
107102

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
117103
- name: Prepare stm32l412nucleo Artifacts
118104
if: matrix.family == 'stm32l4'
119105
run: find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} . \;
120106

121-
- name: Upload stm32l412nucleo Artifacts
122-
if: matrix.family == 'stm32l4'
107+
- name: Upload Artifacts for hardware testing
108+
if: matrix.family == 'stm32l4' || (matrix.family == 'rp2040' && github.repository_owner == 'hathach')
123109
uses: actions/upload-artifact@v3
124110
with:
125-
name: stm32l412nucleo
111+
name: ${{ matrix.family }}
126112
path: |
127113
*.elf
128114
@@ -244,7 +230,7 @@ jobs:
244230
- name: Download stm32l4 Artifacts
245231
uses: actions/download-artifact@v3
246232
with:
247-
name: stm32l412nucleo
233+
name: stm32l4
248234

249235
- name: Create flash.sh
250236
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)