Skip to content

Commit 3d9bc88

Browse files
authored
Cache bootstrap step in all CI workflows (project-chip#24968)
* Move bootstrap configuration files to separate dir Keeping all files used to bootstrap the project in a dedicated directory will simplify environment cache invalidation. * Compatibility for old location of bootstrap script * Cache bootstrap step in all CI workflows * Update constraints location in config files * Hash all pigweed files when creating cache key
1 parent e7528bc commit 3d9bc88

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+522
-157
lines changed

.github/workflows/build.yaml

+46-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ jobs:
6666
run: |
6767
mkdir /tmp/cores || true
6868
sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true
69+
70+
- name: Bootstrap cache
71+
uses: actions/cache@v3
72+
with:
73+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
74+
path: |
75+
.environment
76+
build_overrides/pigweed_environment.gni
6977
- name: Bootstrap
7078
timeout-minutes: 10
7179
run: scripts/build/gn_bootstrap.sh
@@ -77,6 +85,7 @@ jobs:
7785
path: |
7886
.environment/gn_out/.ninja_log
7987
.environment/pigweed-venv/*.log
88+
8089
- name: Setup Build
8190
run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=false"
8291
- name: Run Build
@@ -173,6 +182,14 @@ jobs:
173182
run: |
174183
mkdir /tmp/cores || true
175184
sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true
185+
186+
- name: Bootstrap cache
187+
uses: actions/cache@v3
188+
with:
189+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
190+
path: |
191+
.environment
192+
build_overrides/pigweed_environment.gni
176193
- name: Bootstrap
177194
timeout-minutes: 10
178195
run: scripts/build/gn_bootstrap.sh
@@ -184,6 +201,7 @@ jobs:
184201
path: |
185202
.environment/gn_out/.ninja_log
186203
.environment/pigweed-venv/*.log
204+
187205
- name: Setup and Build Simulated Device
188206
timeout-minutes: 20
189207
run: |
@@ -323,9 +341,18 @@ jobs:
323341
attempt_delay: 2000
324342
- name: Checkout submodules
325343
run: scripts/checkout_submodules.py --shallow --platform linux
344+
345+
- name: Bootstrap cache
346+
uses: actions/cache@v3
347+
with:
348+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
349+
path: |
350+
.environment
351+
build_overrides/pigweed_environment.gni
326352
- name: Bootstrap
327353
timeout-minutes: 10
328354
run: scripts/build/gn_bootstrap.sh
355+
329356
- name: Setup Build, Run Build and Run Tests
330357
timeout-minutes: 50
331358
run: |
@@ -372,6 +399,14 @@ jobs:
372399
- name: Try to ensure the directory for diagnostic log collection exists
373400
run: |
374401
mkdir -p ~/Library/Logs/DiagnosticReports || true
402+
403+
- name: Bootstrap cache
404+
uses: actions/cache@v3
405+
with:
406+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
407+
path: |
408+
.environment
409+
build_overrides/pigweed_environment.gni
375410
- name: Bootstrap
376411
timeout-minutes: 25
377412
run: scripts/build/gn_bootstrap.sh
@@ -383,6 +418,7 @@ jobs:
383418
path: |
384419
.environment/gn_out/.ninja_log
385420
.environment/pigweed-venv/*.log
421+
386422
- name: Setup and Build Simulated Device
387423
timeout-minutes: 20
388424
run: |
@@ -462,6 +498,14 @@ jobs:
462498
attempt_delay: 2000
463499
- name: Checkout submodules
464500
run: scripts/checkout_submodules.py --shallow --platform linux
501+
502+
- name: Bootstrap cache
503+
uses: actions/cache@v3
504+
with:
505+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
506+
path: |
507+
.environment
508+
build_overrides/pigweed_environment.gni
465509
- name: Bootstrap
466510
timeout-minutes: 10
467511
run: scripts/build/gn_bootstrap.sh
@@ -472,8 +516,8 @@ jobs:
472516
name: bootstrap-logs
473517
path: |
474518
.environment/gn_out/.ninja_log
475-
.environment/pigweed-venv/*.log
519+
.environment/pigweed-venv/*.log
520+
476521
- name: Run Build Coverage
477522
timeout-minutes: 20
478523
run: ./scripts/build_coverage.sh
479-

.github/workflows/chef.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ jobs:
4343
attempt_delay: 2000
4444
- name: Checkout submodules
4545
run: scripts/checkout_submodules.py --shallow --platform linux
46+
- name: Bootstrap cache
47+
uses: actions/cache@v3
48+
with:
49+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
50+
path: |
51+
.environment
52+
build_overrides/pigweed_environment.gni
4653
- name: Bootstrap
4754
timeout-minutes: 10
4855
run: scripts/build/gn_bootstrap.sh
@@ -71,6 +78,13 @@ jobs:
7178
attempt_delay: 2000
7279
- name: Checkout submodules
7380
run: scripts/checkout_submodules.py --shallow --platform esp32
81+
- name: Bootstrap cache
82+
uses: actions/cache@v3
83+
with:
84+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
85+
path: |
86+
.environment
87+
build_overrides/pigweed_environment.gni
7488
- name: Bootstrap
7589
timeout-minutes: 10
7690
run: scripts/build/gn_bootstrap.sh
@@ -99,6 +113,13 @@ jobs:
99113
attempt_delay: 2000
100114
- name: Checkout submodules
101115
run: scripts/checkout_submodules.py --shallow --platform nrfconnect
116+
- name: Bootstrap cache
117+
uses: actions/cache@v3
118+
with:
119+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
120+
path: |
121+
.environment
122+
build_overrides/pigweed_environment.gni
102123
- name: Bootstrap
103124
timeout-minutes: 10
104125
run: scripts/build/gn_bootstrap.sh

.github/workflows/darwin-tests.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ jobs:
6464
sudo chown ${USER} /cores || true
6565
mkdir -p ~/Library/Logs/DiagnosticReports || true
6666
mkdir objdir-clone || true
67+
68+
- name: Bootstrap cache
69+
uses: actions/cache@v3
70+
with:
71+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
72+
path: |
73+
.environment
74+
build_overrides/pigweed_environment.gni
6775
- name: Bootstrap
6876
timeout-minutes: 25
6977
run: scripts/build/gn_bootstrap.sh
@@ -75,6 +83,7 @@ jobs:
7583
path: |
7684
.environment/gn_out/.ninja_log
7785
.environment/pigweed-venv/*.log
86+
7887
- name: Delete Defaults
7988
run: defaults delete com.apple.dt.xctest.tool
8089
continue-on-error: true

.github/workflows/darwin.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ jobs:
4444
run: scripts/checkout_submodules.py --shallow --platform darwin
4545
- name: Setup Environment
4646
run: brew install python@3.9
47+
48+
- name: Bootstrap cache
49+
uses: actions/cache@v3
50+
with:
51+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
52+
path: |
53+
.environment
54+
build_overrides/pigweed_environment.gni
4755
- name: Bootstrap
4856
timeout-minutes: 25
4957
run: scripts/build/gn_bootstrap.sh
@@ -55,6 +63,7 @@ jobs:
5563
path: |
5664
.environment/gn_out/.ninja_log
5765
.environment/pigweed-venv/*.log
66+
5867
- name: Block zap-cli from being used
5968
# xcodebuild is NOT expected to require zap-cli
6069
run: scripts/run_in_build_env.sh 'mv $PW_ENVIRONMENT_ROOT/cipd/packages/zap/zap-cli $PW_ENVIRONMENT_ROOT/cipd/packages/zap/zap-cli.moved'

.github/workflows/docbuild.yaml

+3-6
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@ jobs:
2727
path: matter
2828
fetch-depth: 0
2929
- name: Install Python
30-
uses: actions/setup-python@v2
30+
uses: actions/setup-python@v4
3131
with:
3232
python-version: 3.8
33-
- name: cache-pip
34-
uses: actions/cache@v1
35-
with:
36-
path: ~/.cache/pip
37-
key: ${{ runner.os }}-doc-pip
33+
cache-dependency-path: matter/docs/requirements.txt
34+
cache: pip
3835
- name: Install base dependencies
3936
working-directory: matter
4037
run: |

.github/workflows/examples-ameba.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ jobs:
4949
attempt_delay: 2000
5050
- name: Checkout submodules
5151
run: scripts/checkout_submodules.py --shallow --platform ameba
52+
- name: Bootstrap cache
53+
uses: actions/cache@v3
54+
with:
55+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
56+
path: |
57+
.environment
58+
build_overrides/pigweed_environment.gni
59+
- name: Bootstrap
60+
run: scripts/build/gn_bootstrap.sh
5261
- name: Build example Ameba All Clusters App
5362
run: |
5463
./scripts/run_in_build_env.sh \

.github/workflows/examples-bouffalolab.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ jobs:
5555
env:
5656
GH_CONTEXT: ${{ toJson(github) }}
5757
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
58-
58+
59+
- name: Bootstrap cache
60+
uses: actions/cache@v3
61+
with:
62+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
63+
path: |
64+
.environment
65+
build_overrides/pigweed_environment.gni
5966
- name: Bootstrap
6067
timeout-minutes: 25
6168
run: scripts/build/gn_bootstrap.sh
@@ -67,6 +74,7 @@ jobs:
6774
path: |
6875
.environment/gn_out/.ninja_log
6976
.environment/pigweed-venv/*.log
77+
7078
- name: Build example BL602 Lighting App
7179
timeout-minutes: 30
7280
run: |

.github/workflows/examples-cc13x2x7_26x2x7.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ jobs:
5656
env:
5757
GH_CONTEXT: ${{ toJson(github) }}
5858
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
59+
60+
- name: Bootstrap cache
61+
uses: actions/cache@v3
62+
with:
63+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
64+
path: |
65+
.environment
66+
build_overrides/pigweed_environment.gni
5967
- name: Bootstrap
6068
timeout-minutes: 25
6169
run: scripts/build/gn_bootstrap.sh
@@ -67,6 +75,7 @@ jobs:
6775
path: |
6876
.environment/gn_out/.ninja_log
6977
.environment/pigweed-venv/*.log
78+
7079
- name: Build examples
7180
timeout-minutes: 100
7281
run: |

.github/workflows/examples-cc32xx.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ jobs:
5353
env:
5454
GH_CONTEXT: ${{ toJson(github) }}
5555
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
56+
57+
- name: Bootstrap cache
58+
uses: actions/cache@v3
59+
with:
60+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
61+
path: |
62+
.environment
63+
build_overrides/pigweed_environment.gni
5664
- name: Bootstrap
5765
timeout-minutes: 25
5866
run: scripts/build/gn_bootstrap.sh
@@ -64,6 +72,7 @@ jobs:
6472
path: |
6573
.environment/gn_out/.ninja_log
6674
.environment/pigweed-venv/*.log
75+
6776
- name: Build examples
6877
timeout-minutes: 60
6978
run: |
@@ -79,7 +88,7 @@ jobs:
7988
cc32xx CC3235SF_LAUNCHXL lock \
8089
out/artifacts/cc32xx-lock/chip-CC3235SF_LAUNCHXL-lock-example.out \
8190
/tmp/bloat_reports/
82-
91+
8392
- name: Uploading Size Reports
8493
uses: actions/upload-artifact@v2
8594
if: ${{ !env.ACT }}

.github/workflows/examples-efr32.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ jobs:
6262
GH_CONTEXT: ${{ toJson(github) }}
6363
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
6464

65+
- name: Bootstrap cache
66+
uses: actions/cache@v3
67+
with:
68+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
69+
path: |
70+
.environment
71+
build_overrides/pigweed_environment.gni
6572
- name: Bootstrap
6673
timeout-minutes: 25
6774
run: scripts/build/gn_bootstrap.sh

.github/workflows/examples-esp32.yaml

+15-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ jobs:
5656
GH_CONTEXT: ${{ toJson(github) }}
5757
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
5858

59+
- name: Bootstrap cache
60+
uses: actions/cache@v3
61+
with:
62+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
63+
path: |
64+
.environment
65+
build_overrides/pigweed_environment.gni
5966
- name: Bootstrap
6067
timeout-minutes: 10
6168
run: scripts/build/gn_bootstrap.sh
@@ -67,6 +74,7 @@ jobs:
6774
path: |
6875
.environment/gn_out/.ninja_log
6976
.environment/pigweed-venv/*.log
77+
7078
- name: Build some M5Stack variations
7179
timeout-minutes: 60
7280
run: |
@@ -164,10 +172,16 @@ jobs:
164172
- name: Checkout submodules
165173
run: scripts/checkout_submodules.py --shallow --platform esp32
166174

175+
- name: Bootstrap cache
176+
uses: actions/cache@v3
177+
with:
178+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
179+
path: |
180+
.environment
181+
build_overrides/pigweed_environment.gni
167182
- name: Bootstrap
168183
timeout-minutes: 10
169184
run: scripts/build/gn_bootstrap.sh
170-
171185
- name: Uploading bootstrap logs
172186
uses: actions/upload-artifact@v3
173187
if: ${{ always() && !env.ACT }}

.github/workflows/examples-infineon.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ jobs:
5656
GH_CONTEXT: ${{ toJson(github) }}
5757
run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}"
5858

59+
- name: Bootstrap cache
60+
uses: actions/cache@v3
61+
with:
62+
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
63+
path: |
64+
.environment
65+
build_overrides/pigweed_environment.gni
5966
- name: Bootstrap
6067
timeout-minutes: 25
6168
run: scripts/build/gn_bootstrap.sh
@@ -67,6 +74,7 @@ jobs:
6774
path: |
6875
.environment/gn_out/.ninja_log
6976
.environment/pigweed-venv/*.log
77+
7078
- name: Build PSoC6 lock-app example
7179
timeout-minutes: 15
7280
run: |

0 commit comments

Comments
 (0)