Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rule to fast compile all existing chef devices on PRs #37914

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,28 @@ 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)
timeout-minutes: 60
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
Expand Down
23 changes: 23 additions & 0 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [ # These do not compile / deprecated.
"noip_rootnode_dimmablelight_bCwGYSDpoe",
"rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680",
]

gen_dir = "" # Filled in after sample app type is read from args.

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
#
Expand Down
Loading