From 9193a3db8f6738bc4c0c9b5c59832cbb541394f7 Mon Sep 17 00:00:00 2001 From: Austin Bozowski Date: Tue, 24 May 2022 23:54:53 +0000 Subject: [PATCH] Make CI uniform --- .github/workflows/chef.yaml | 6 +++--- examples/chef/chef.py | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index a65dc63adb3c1f..32a976ef78fc45 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -68,7 +68,7 @@ jobs: - name: lighting-app Linux shell: bash run: | - ./scripts/run_in_build_env.sh "cd examples/chef; ./chef.py -br --use_zzz -d lighting-app -t linux;" + ./scripts/run_in_build_env.sh "cd examples/chef; ./chef.py --ci -t linux;" chef_esp32: name: Chef - ESP32 CI Examples @@ -92,7 +92,7 @@ jobs: - name: lighting-app ESP32 shell: bash run: | - ./scripts/run_in_build_env.sh "cd examples/chef; ./chef.py -br --use_zzz -d lighting-app -t esp32;" + ./scripts/run_in_build_env.sh "cd examples/chef; ./chef.py --ci -t esp32;" chef_nrfconnect: name: Chef - NRFConnect CI Examples @@ -116,4 +116,4 @@ jobs: - name: lighting-app NRFConnect shell: bash run: | - ./scripts/run_in_build_env.sh "cd examples/chef; export GNUARMEMB_TOOLCHAIN_PATH=\"$PW_ARM_CIPD_INSTALL_DIR\"; ./chef.py -br --use_zzz -d lighting-app -t nrfconnect;" + ./scripts/run_in_build_env.sh "cd examples/chef; ./chef.py --ci -t nrfconnect;" diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 6a9a8940b14201..705395fa8d978f 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -175,7 +175,7 @@ def main(argv: Sequence[str]) -> None: parser.add_option("", "--validate_zzz", help="Checks if cached ZAP output needs to be regenrated, for use in CI. If this flag is set, all other arguments are ignored.", dest="validate_zzz", action="store_true") parser.add_option("", "--use_zzz", help="Use pre generated output from the ZAP tool found in the zzz_generated folder. Used to decrease execution time of CI jobs", dest="use_zzz", action="store_true") parser.add_option("", "--build_all", help="Builds all chef examples across all platforms and collates artifacts. Chef exits after completion.", dest="build_all", action="store_true") - parser.add_option("", "--ci", help="Builds Chef examples defined in chef_util.ci_allowlist. Uses specified target. Chef exits after completion.", dest="ci", action="store_true") + parser.add_option("", "--ci", help="Builds Chef examples defined in chef_util.ci_allowlist. Uses specified target. Chef exits after completion.", dest="ci", action="store_true") options, _ = parser.parse_args(argv) @@ -256,6 +256,21 @@ def main(argv: Sequence[str]) -> None: chef_util.generate_device_manifest(chef_devices_dir, include_zap_submod=True, write_manifest_file = True, ci_manifest_file_name = ci_manifest_file_name, repo_base_path=_REPO_BASE_PATH) exit(0) + # + # CI + # + + if options.ci: + if options.build_target == "nrfconnect": + os.environ['GNUARMEMB_TOOLCHAIN_PATH'] = os.environ['PW_ARM_CIPD_INSTALL_DIR'] + for device_dir_item in os.listdir(chef_devices_dir): + target_file_ext = ".zap" + if device_dir_item.endswith(target_file_ext) and device_dir_item in chef_util.ci_allowlist: + device_name = device_dir_item[:-len(target_file_ext)] + command = './chef.py -cbr --use-zzz -d {} -t {}'.format(device_name, options.build_target) + subprocess.check_call(command, cwd=_CHEF_SCRIPT_PATH, shell=True) + exit(0) + # # Build all #