Merge pull request #1941 from hathach/minor-ci

Minor ci
This commit is contained in:
Ha Thach 2023-03-08 13:08:25 +07:00 committed by GitHub
commit be66f5f57f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 35 deletions

View File

@ -34,28 +34,22 @@ jobs:
# Alphabetical order # Alphabetical order
- 'broadcom_32bit' - 'broadcom_32bit'
- 'imxrt' - 'imxrt'
- 'lpc15' - 'lpc15 lpc18'
- 'lpc18' - 'lpc54 lpc55'
- 'lpc54' - 'mm32 msp432e4'
- 'lpc55'
- 'mm32'
- 'msp432e4'
- 'nrf' - 'nrf'
- 'rp2040' - 'rp2040'
- 'samd11' - 'samd11'
- 'samd21' - 'samd21'
- 'samd51' - 'samd51'
- 'saml2x' - 'saml2x'
- 'stm32f0' - 'stm32f0 stm32f1'
- 'stm32f1'
- 'stm32f4' - 'stm32f4'
- 'stm32f7' - 'stm32f7'
- 'stm32g4' - 'stm32g4 stm32wb'
- 'stm32h7' - 'stm32h7'
- 'stm32l4' - 'stm32l4'
- 'stm32wb' - 'tm4c123 xmc4000'
- 'tm4c123'
- 'xmc4000'
steps: steps:
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
@ -71,7 +65,7 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Checkout common submodules in lib - name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
- name: Checkout hathach/linkermap - name: Checkout hathach/linkermap
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -100,29 +94,21 @@ jobs:
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"' find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done done
# Upload binaries for rp2040 hardware test with self-hosted # Upload binaries for rp2040/stm32l412nucleo hardware test with self-hosted
- name: Prepare rp2040 Artifacts - name: Prepare rp2040 Artifacts
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach' if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
run: find examples/ -name "*.elf" -exec mv {} . \; run: find examples/ -name "*.elf" -exec mv {} . \;
- name: Upload rp2040 Artifacts
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.family }}
path: |
*.elf
# Upload binaries for stm32l412nucleo hardware test with self-hosted
- name: Prepare stm32l412nucleo Artifacts - name: Prepare stm32l412nucleo Artifacts
if: matrix.family == 'stm32l4' if: matrix.family == 'stm32l4'
run: find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} . \; run: find examples/ -path "*stm32l412nucleo/*.elf" -exec mv {} . \;
- name: Upload stm32l412nucleo Artifacts - name: Upload Artifacts for hardware testing
if: matrix.family == 'stm32l4' if: matrix.family == 'stm32l4' || (matrix.family == 'rp2040' && github.repository_owner == 'hathach')
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: stm32l412nucleo name: ${{ matrix.family }}
path: | path: |
*.elf *.elf
@ -244,7 +230,7 @@ jobs:
- name: Download stm32l4 Artifacts - name: Download stm32l4 Artifacts
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: stm32l412nucleo name: stm32l4
- name: Create flash.sh - name: Create flash.sh
run: | run: |

View File

@ -196,6 +196,7 @@ get-deps:
git -C $(TOP) submodule update --init $(DEPS_SUBMODULES) git -C $(TOP) submodule update --init $(DEPS_SUBMODULES)
endif endif
.PHONY: size
size: $(BUILD)/$(PROJECT).elf size: $(BUILD)/$(PROJECT).elf
-@echo '' -@echo ''
@$(SIZE) $< @$(SIZE) $<

View File

@ -85,21 +85,22 @@ def build_example(example, board, make_option):
# succeeded, failed, skipped # succeeded, failed, skipped
ret = [0, 0, 0] ret = [0, 0, 0]
make_cmd = "make -j -C examples/{} BOARD={} {}".format(example, board, make_option)
# Check if board is skipped # Check if board is skipped
if skip_example(example, board): if skip_example(example, board):
status = SKIPPED status = SKIPPED
ret[2] = 1 ret[2] = 1
print(build_format.format(example, board, status, '-', flash_size, sram_size)) print(build_format.format(example, board, status, '-', flash_size, sram_size))
else: else:
build_result = subprocess.run("make -j -C examples/{} BOARD={} {} all".format(example, board, make_option), shell=True, subprocess.run(make_cmd + " clean", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) build_result = subprocess.run(make_cmd + " all", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if build_result.returncode == 0: if build_result.returncode == 0:
status = SUCCEEDED status = SUCCEEDED
ret[0] = 1 ret[0] = 1
(flash_size, sram_size) = build_size(example, board) (flash_size, sram_size) = build_size(make_cmd)
subprocess.run("make -j -C examples/{} BOARD={} {} copy-artifact".format(example, board, make_option), shell=True, #subprocess.run(make_cmd + " copy-artifact", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
else: else:
status = FAILED status = FAILED
ret[1] = 1 ret[1] = 1
@ -113,9 +114,8 @@ def build_example(example, board, make_option):
return ret return ret
def build_size(example, board): def build_size(make_cmd):
size_cmd = 'make -j -C examples/{} BOARD={} size'.format(example, board) size_output = subprocess.run(make_cmd + ' size', shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8").splitlines()
size_output = subprocess.run(size_cmd, shell=True, stdout=subprocess.PIPE).stdout.decode("utf-8").splitlines()
for i, l in enumerate(size_output): for i, l in enumerate(size_output):
text_title = 'text data bss dec' text_title = 'text data bss dec'
if text_title in l: if text_title in l: