Skip to content

Commit

Permalink
Make CI uniform
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed May 24, 2022
1 parent 91c7a22 commit 9193a3d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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;"
17 changes: 16 additions & 1 deletion examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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

0 comments on commit 9193a3d

Please sign in to comment.