Skip to content

Commit

Permalink
Make Chef CI use existing zzz_generated and complete Chef CD for exis…
Browse files Browse the repository at this point in the history
…ting platforms (#19478)

* Squashed commit of the following:

commit b5d5920
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 18:17:34 2022 +0000

    [no ci] comment

commit 7c5fb08
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 18:15:37 2022 +0000

    [no ci] Make border nice

commit d67a7bc
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 18:09:29 2022 +0000

    [no ci] restyle

commit 5783829
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 17:48:39 2022 +0000

    Add error handling to build all

commit 083b072
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 17:15:33 2022 +0000

    [no ci] update build image version

commit 48805a8
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 08:20:49 2022 +0000

    [no ci] minor

commit 3cae95c
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 08:15:22 2022 +0000

    [no ci] Minor

commit df929b2
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 07:37:49 2022 +0000

    Minor

commit 759ddb0
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 07:28:36 2022 +0000

    Minor

commit d9ca2a6
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 07:22:03 2022 +0000

    Style

commit dbb9b30
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 06:50:11 2022 +0000

    Style

commit 3daff46
Author: Austin Bozowski <[email protected]>
Date:   Fri Jun 10 02:58:43 2022 +0000

    nrf bundle

commit 7d38eb4
Author: Austin Bozowski <[email protected]>
Date:   Wed Jun 8 16:34:57 2022 +0000

    Linux bundle

commit fd5689e
Author: Austin Bozowski <[email protected]>
Date:   Wed Jun 8 09:08:42 2022 +0000

    Make esp32 generic

commit 1af3a2e
Author: Austin Bozowski <[email protected]>
Date:   Tue Jun 7 08:35:52 2022 +0000

    Missed comment

commit 5f7c41c
Author: Austin Bozowski <[email protected]>
Date:   Tue Jun 7 08:32:07 2022 +0000

    Example bundle function

* Bundle .matter, metadata & ensure .matter commit

* Add partial check for .matter regen

* Restyle and spelling

* Address comments

* Remove reflection

* Generate zzz, .MATTERMD5 should go away in future

* Temp del workflows

* Remove chef exclusion from regen

* Make regen all put chef exs in individual dirs

* Remove validate zzz

* Remove unused code from chef, change use_zzz

* Skip util test files in gen all

* Commit chef in root zzz

* Delete chef zzz

* Clean chef .matter files

* Add post build for chef

* Change .matter bundle rc to oot zzz

* Generated files

* Restore workflows

* Change open to with

* Restyle
  • Loading branch information
aBozowski authored and pull[bot] committed Jul 29, 2022
1 parent e7f3461 commit 4008495
Show file tree
Hide file tree
Showing 175 changed files with 185 additions and 279 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,8 @@ concurrency:

jobs:

validate_zzz:
name: Chef - Validate cached ZAP output
runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'
container:
image: connectedhomeip/chip-build:0.5.79
options: --user root
steps:
- uses: Wandalen/[email protected]
name: Checkout
with:
action: actions/checkout@v3
with: |
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Chef validate zzz
shell: bash
run: |
cd examples/chef
python3 chef.py --validate_zzz
chef_linux:
name: Chef - Linux CI Examples
needs: validate_zzz
runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

Expand All @@ -72,7 +49,6 @@ jobs:
chef_esp32:
name: Chef - ESP32 CI Examples
needs: validate_zzz
runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

Expand All @@ -96,7 +72,6 @@ jobs:
chef_nrfconnect:
name: Chef - NRFConnect CI Examples
needs: validate_zzz
runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

Expand Down
58 changes: 4 additions & 54 deletions examples/chef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,61 +61,11 @@ Run `chef.py -h` to see the available commands

## CI

### zzz_generated

To eliminate a dependency on ZAP in CI jobs, all chef examples found in
`examples/chef/devices` must have their output from the ZAP tool cached in
`examples/chef/zzz_generated`.

To generate the cache, one may execute chef with the option `--generate_zzz`.
This will run ZAP for all devices in `examples/chef/devices` and place the
output into the appropriate directory structure.

Other than the output from the ZAP tool, the cache directory contains two
additional files for each device:

- `INPUTMD5.txt` contains the md5 hex digest of the ZAP file used to generate
the directory.
- `ZAPSHA.txt` contains the commit of ZAP in the user's tree when the
directory was generated.

```
zzz_generated/
└── lighting-app
├── INPUTMD5.txt
├── zap-generated
│   ├── access.h
│   ├── af-gen-event.h
│   └── ...
└── ZAPSHA.txt
```

These additional files will be used by the CI jobs to validate whether the cache
must be regenerated i.e. regeneration is needed when ZAP or the input ZAP files
change.

### Workflow

All CI jobs for chef can be found in `.github/workflows/chef.yaml`.

#### Validate

The workflow begins by calling chef with `--validate_zzz`.

`--validate_zzz` will recalculate the current ZAP commit and the md5 of all
example ZAP files and compare with what is committed to `zzz_generated`.

If the validation job fails, it will provide instructions to repair
`zzz_generated` and no builds will run.

#### Build

Once the validation job is complete, there is a separate job for each platform,
which run in parallel.

These jobs use a platform-specific image with base `chip-build`.

The build jobs call chef with the options `--ci -t <PLATFORM>`. The `--ci`
option will execute builds for all devices specified in `_CI_ALLOW_LIST` defined
in `chef.py` (so long as these devices are also in `/devices`) on the specified
platform.
CI jobs call chef with the options `--ci -t <PLATFORM>`. The `--ci` option will
execute builds for all devices specified in `cicd_config["ci_allow_list"]`
defined in `chef.py` (so long as these devices are also in `/devices`) on the
specified platform.
Loading

0 comments on commit 4008495

Please sign in to comment.