From 78daf642a8242f713e492d4417ee3216caafc3d2 Mon Sep 17 00:00:00 2001 From: Shreyas Balakrishna Bhandare Date: Thu, 6 Mar 2025 16:34:37 -0800 Subject: [PATCH 1/4] Add rule to fast compile all existing chef devices --- .github/workflows/chef.yaml | 21 +++++++++++++++++++++ examples/chef/chef.py | 23 +++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 06580f6408c552..7271f686fdfec3 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -51,6 +51,27 @@ jobs: run: | ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t linux" + chef_linux_all_devices: + name: Chef - Linux CI Examples (All chef devices) + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:119 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux + - name: CI Examples Linux + shell: bash + run: | + ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci_linux" + chef_esp32: name: Chef - ESP32 CI Examples runs-on: ubuntu-latest diff --git a/examples/chef/chef.py b/examples/chef/chef.py index d78ef124d0b064..fe0af5e4e9b023 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -40,6 +40,10 @@ for file in os.listdir(_DEVICE_FOLDER) if file.endswith(".zap") and file != 'template.zap'] _CICD_CONFIG_FILE_NAME = os.path.join(_CHEF_SCRIPT_PATH, "cicd_config.json") _CD_STAGING_DIR = os.path.join(_CHEF_SCRIPT_PATH, "staging") +_EXCLUDE_DEVICE_FROM_LINUX_CI = [ + "noip_rootnode_dimmablelight_bCwGYSDpoe", + "rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680", +] gen_dir = "" # Filled in after sample app type is read from args. @@ -382,6 +386,10 @@ def main() -> int: help=("Builds Chef examples defined in cicd_config. " "Uses specified target from -t. Chef exits after completion."), dest="ci", action="store_true") + parser.add_option("", "--ci_linux", + help=("Builds Chef Examples defined in cicd_config under ci_allow_list_linux. " + "Devices are built without -c for faster compilation."), + dest="ci_linux", action="store_true") parser.add_option( "", "--enable_ipv4", help="Enable IPv4 mDNS. Only applicable to platforms that can support IPV4 (e.g, Linux, ESP32)", action="store_true", default=False) @@ -409,6 +417,21 @@ def main() -> int: bundle(options.build_target, device_name) exit(0) + # + # CI Linux + # + + if options.ci_linux: + for device_name in _DEVICE_LIST: + if device_name in _EXCLUDE_DEVICE_FROM_LINUX_CI: + continue + shell.run_cmd(f"cd {_CHEF_SCRIPT_PATH}") + command = f"./chef.py -br -d {device_name} -t linux" + flush_print(f"Building {command}", with_border=True) + shell.run_cmd(command) + bundle("linux", device_name) + exit(0) + # # CD # From 7443c8e0e974f7f30a639339d2d18105c9e3ad52 Mon Sep 17 00:00:00 2001 From: Shreyas Bhandare Date: Fri, 7 Mar 2025 18:39:57 +0000 Subject: [PATCH 2/4] Comment informing about excluded devices --- examples/chef/chef.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index fe0af5e4e9b023..825c7de6d3628d 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -40,7 +40,7 @@ for file in os.listdir(_DEVICE_FOLDER) if file.endswith(".zap") and file != 'template.zap'] _CICD_CONFIG_FILE_NAME = os.path.join(_CHEF_SCRIPT_PATH, "cicd_config.json") _CD_STAGING_DIR = os.path.join(_CHEF_SCRIPT_PATH, "staging") -_EXCLUDE_DEVICE_FROM_LINUX_CI = [ +_EXCLUDE_DEVICE_FROM_LINUX_CI = [ # These do not compile / deprecated. "noip_rootnode_dimmablelight_bCwGYSDpoe", "rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680", ] From a13d3345caa8ecb2a5421aa6039f75857dd451b9 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 7 Mar 2025 18:44:16 +0000 Subject: [PATCH 3/4] Restyled by autopep8 --- examples/chef/chef.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 825c7de6d3628d..bff289f250497d 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -40,7 +40,7 @@ for file in os.listdir(_DEVICE_FOLDER) if file.endswith(".zap") and file != 'template.zap'] _CICD_CONFIG_FILE_NAME = os.path.join(_CHEF_SCRIPT_PATH, "cicd_config.json") _CD_STAGING_DIR = os.path.join(_CHEF_SCRIPT_PATH, "staging") -_EXCLUDE_DEVICE_FROM_LINUX_CI = [ # These do not compile / deprecated. +_EXCLUDE_DEVICE_FROM_LINUX_CI = [ # These do not compile / deprecated. "noip_rootnode_dimmablelight_bCwGYSDpoe", "rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680", ] From 2ad115f54165bb3159d19343d8b099f7dbad3713 Mon Sep 17 00:00:00 2001 From: Shreyas Balakrishna Bhandare Date: Fri, 7 Mar 2025 11:00:05 -0800 Subject: [PATCH 4/4] Add job timeout of 60 mins for compile all chef --- .github/workflows/chef.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 7271f686fdfec3..bc925c56de028b 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -53,6 +53,7 @@ jobs: chef_linux_all_devices: name: Chef - Linux CI Examples (All chef devices) + timeout-minutes: 60 runs-on: ubuntu-latest if: github.actor != 'restyled-io[bot]'