Skip to content

Commit

Permalink
[mbed] Fix build out of space issue (#27506)
Browse files Browse the repository at this point in the history
* [mbed] Extend Python build with ota-requestor-app

Add ota-requestor-app to Python builder.
This allows for covering all supported examples.

Signed-off-by: ATmobica <artur.tynecki@arm.com>

* [mbed] CI workflow improvements

Remove changed path detection steps.
Replace custom build script with Python builder.
The application output goes into `out` directory
and does not dirty the source (#27480).

Signed-off-by: ATmobica <artur.tynecki@arm.com>

---------

Signed-off-by: ATmobica <artur.tynecki@arm.com>
  • Loading branch information
ATmobica authored and pull[bot] committed Nov 17, 2023
1 parent c037133 commit 4947161
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 41 deletions.
98 changes: 58 additions & 40 deletions .github/workflows/examples-mbed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ concurrency:

env:
CHIP_NO_LOG_TIMESTAMPS: true

jobs:
mbedos:
name: Mbed OS examples building

env:
BUILD_TYPE: mbedos
PLATFORM_NAME: mbed
APP_PROFILE: release
APP_TARGET: CY8CPROTO_062_4343W
APP_TARGET: cy8cproto_062_4343w

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'
Expand All @@ -52,16 +52,6 @@ jobs:
with:
platform: mbed

- name: Detect changed paths
uses: dorny/paths-filter@v2
id: changed_paths
with:
filters: |
mbed:
- '**/mbed/**'
pigweedapp:
- 'examples/pigweed-app/mbed/**'
- name: Set up environment for size reports
uses: ./.github/actions/setup-size-reports
if: ${{ !env.ACT }}
Expand All @@ -70,70 +60,98 @@ jobs:

- name: Build lock-app example
run: |
scripts/examples/mbed_example.sh -a=lock-app -b=$APP_TARGET -p=$APP_PROFILE
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target $PLATFORM_NAME-$APP_TARGET-lock-$APP_PROFILE \
build \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
mbed $APP_TARGET+$APP_PROFILE lock-app \
examples/lock-app/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-lock-app-example.elf \
$PLATFORM_NAME $APP_TARGET lock-app-$APP_PROFILE \
out/$PLATFORM_NAME-$APP_TARGET-lock-$APP_PROFILE/chip-mbed-lock-app-example.elf \
/tmp/bloat_reports/
rm -rf ./out
- name: Build lighting-app example
if: github.event_name == 'push' || steps.changed_paths.outputs.mbed == 'true'
if: github.event_name == 'push'
run: |
scripts/examples/mbed_example.sh -a=lighting-app -b=$APP_TARGET -p=$APP_PROFILE
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target $PLATFORM_NAME-$APP_TARGET-light-$APP_PROFILE \
build \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
mbed $APP_TARGET+$APP_PROFILE lighting-app \
examples/lighting-app/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-lighting-app-example.elf \
$PLATFORM_NAME $APP_TARGET lighting-app-$APP_PROFILE \
out/$PLATFORM_NAME-$APP_TARGET-light-$APP_PROFILE/chip-mbed-lighting-app-example.elf \
/tmp/bloat_reports/
rm -rf ./out
- name: Build pigweed-app example
if: github.event_name == 'push' || steps.changed_paths.outputs.pigweedapp == 'true'
if: github.event_name == 'push'
run: |
scripts/examples/mbed_example.sh -a=pigweed-app -b=$APP_TARGET -p=$APP_PROFILE
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target $PLATFORM_NAME-$APP_TARGET-pigweed-$APP_PROFILE \
build \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
mbed $APP_TARGET+$APP_PROFILE pigweed-app \
examples/pigweed-app/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-pigweed-app-example.elf \
$PLATFORM_NAME $APP_TARGET pigweed-app-$APP_PROFILE \
out/$PLATFORM_NAME-$APP_TARGET-pigweed-$APP_PROFILE/chip-mbed-pigweed-app-example.elf \
/tmp/bloat_reports/
rm -rf ./out
- name: Build all-clusters-app example
if: github.event_name == 'push' || steps.changed_paths.outputs.mbed == 'true'
if: github.event_name == 'push'
run: |
scripts/examples/mbed_example.sh -a=all-clusters-app -b=$APP_TARGET -p=$APP_PROFILE
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target $PLATFORM_NAME-$APP_TARGET-all-clusters-$APP_PROFILE \
build \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
mbed $APP_TARGET+$APP_PROFILE all-clusters-app \
examples/all-clusters-app/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-all-clusters-app-example.elf \
$PLATFORM_NAME $APP_TARGET all-clusters-app-$APP_PROFILE \
out/$PLATFORM_NAME-$APP_TARGET-all-clusters-$APP_PROFILE/chip-mbed-all-clusters-app-example.elf \
/tmp/bloat_reports/
rm -rf ./out
- name: Build all-clusters-minimal-app example
if: github.event_name == 'push' || steps.changed_paths.outputs.mbed == 'true'
if: github.event_name == 'push'
run: |
scripts/examples/mbed_example.sh -a=all-clusters-minimal-app -b=$APP_TARGET -p=$APP_PROFILE
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target $PLATFORM_NAME-$APP_TARGET-all-clusters-minimal-$APP_PROFILE \
build \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
mbed $APP_TARGET+$APP_PROFILE all-clusters-minimal-app \
examples/all-clusters-minimal-app/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-all-clusters-minimal-app-example.elf \
$PLATFORM_NAME $APP_TARGET all-clusters-minimal-app-$APP_PROFILE \
out/$PLATFORM_NAME-$APP_TARGET-all-clusters-minimal-$APP_PROFILE/chip-mbed-all-clusters-minimal-app-example.elf \
/tmp/bloat_reports/
rm -rf ./out
- name: Build shell example
if: github.event_name == 'push' || steps.changed_paths.outputs.mbed == 'true'
if: github.event_name == 'push'
run: |
scripts/examples/mbed_example.sh -a=shell -b=$APP_TARGET -p=$APP_PROFILE
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target $PLATFORM_NAME-$APP_TARGET-shell-$APP_PROFILE \
build \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
mbed $APP_TARGET+$APP_PROFILE shell \
examples/shell/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-shell-example.elf \
$PLATFORM_NAME $APP_TARGET shell-app-$APP_PROFILE \
out/$PLATFORM_NAME-$APP_TARGET-shell-$APP_PROFILE/chip-mbed-shell-example.elf \
/tmp/bloat_reports/
rm -rf ./out
- name: Build ota-requestor-app example
if: github.event_name == 'push' || steps.changed_paths.outputs.mbed == 'true'
if: github.event_name == 'push'
run: |
scripts/examples/mbed_example.sh -a=ota-requestor-app -b=$APP_TARGET -p=$APP_PROFILE
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target $PLATFORM_NAME-$APP_TARGET-ota-requestor-$APP_PROFILE \
build \
"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
mbed $APP_TARGET+$APP_PROFILE shell \
examples/ota-requestor-app/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-ota-requestor-app-example.elf \
$PLATFORM_NAME $APP_TARGET ota-requestor-app-$APP_PROFILE \
out/$PLATFORM_NAME-$APP_TARGET-ota-requestor-$APP_PROFILE/chip-mbed-ota-requestor-app-example.elf \
/tmp/bloat_reports/
rm -rf ./out
Expand Down
1 change: 1 addition & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ def BuildMbedTarget():
TargetPart('all-clusters', app=MbedApp.ALL_CLUSTERS),
TargetPart('all-clusters-minimal', app=MbedApp.ALL_CLUSTERS_MINIMAL),
TargetPart('pigweed', app=MbedApp.PIGWEED),
TargetPart('ota-requestor', app=MbedApp.OTA_REQUESTOR),
TargetPart('shell', app=MbedApp.SHELL),
])

Expand Down
5 changes: 5 additions & 0 deletions scripts/build/builders/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class MbedApp(Enum):
ALL_CLUSTERS_MINIMAL = auto()
PIGWEED = auto()
SHELL = auto()
OTA_REQUESTOR = auto()

@property
def ExampleName(self):
Expand All @@ -39,6 +40,8 @@ def ExampleName(self):
return 'all-clusters-minimal-app'
elif self == MbedApp.PIGWEED:
return 'pigweed-app'
elif self == MbedApp.OTA_REQUESTOR:
return 'ota-requestor-app'
elif self == MbedApp.SHELL:
return 'shell'
else:
Expand All @@ -56,6 +59,8 @@ def AppNamePrefix(self):
return 'chip-mbed-all-clusters-minimal-app-example'
elif self == MbedApp.PIGWEED:
return 'chip-mbed-pigweed-app-example'
elif self == MbedApp.OTA_REQUESTOR:
return 'chip-mbed-ota-requestor-app-example'
elif self == MbedApp.SHELL:
return 'chip-mbed-shell-example'
else:
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/testdata/all_targets_linux_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ linux-x64-efr32-test-runner[-clang]
imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release]
infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage]
k32w-{light,shell,lock,contact}[-se05x][-no-ble][-no-ota][-low-power][-nologs][-crypto-platform][-tokenizer]
mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,shell}[-release][-develop][-debug]
mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,ota-requestor,shell}[-release][-develop][-debug]
mw320-all-clusters-app
nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc]
nrf-native-posix-64-tests
Expand Down

0 comments on commit 4947161

Please sign in to comment.