Revert "CI: Don't run bootstrap if we restored from cache (#32610)" (#32650)
This reverts commit 82287051caf2bd8a80dce800f21f92a27c4f31dd.
diff --git a/.github/actions/bootstrap-cache/action.yaml b/.github/actions/bootstrap-cache/action.yaml
index 9a883ec..b22ed1e 100644
--- a/.github/actions/bootstrap-cache/action.yaml
+++ b/.github/actions/bootstrap-cache/action.yaml
@@ -1,5 +1,5 @@
name: Bootstrap cache
-description: Bootstrap cache (deprecated)
+description: Bootstrap cache
runs:
using: "composite"
steps:
diff --git a/.github/actions/bootstrap/action.yaml b/.github/actions/bootstrap/action.yaml
index 32fe6c9..8f94830 100644
--- a/.github/actions/bootstrap/action.yaml
+++ b/.github/actions/bootstrap/action.yaml
@@ -5,40 +5,9 @@
description: "Platform name"
required: false
default: none
- bootstrap-log-name:
- description: "Bootstrap log name"
- required: false
- default: bootstrap-logs-${{ github.job }}
-
runs:
using: "composite"
steps:
- - uses: Wandalen/wretry.action@v1.4.10
- name: Bootstrap from cache
- id: bootstrap-cache
- continue-on-error: true
- with:
- action: buildjet/cache@v4
- attempt_limit: 3
- attempt_delay: 2000
- with: |
- key: ${{ runner.os }}-${{ inputs.platform }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
- path: |
- .environment
- build_overrides/pigweed_environment.gni
-
- - name: Run bootstrap
- if: fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit != 'true' # retry returns all outputs in `outputs`
- env:
- PW_NO_CIPD_CACHE_DIR: Y
+ - name: Bootstrap
shell: bash
- run: source scripts/bootstrap.sh -p all,${{ inputs.platform }}
-
- - name: Uploading bootstrap logs
- uses: actions/upload-artifact@v3
- if: always() && !env.ACT && fromJSON(steps.bootstrap-cache.outputs.outputs).cache-hit != 'true'
- with:
- name: ${{ inputs.bootstrap-log-name }}
- path: |
- .environment/gn_out/.ninja_log
- .environment/pigweed-venv/*.log
+ run: bash scripts/bootstrap.sh -p all,${{ inputs.platform }}
diff --git a/.github/actions/checkout-submodules-and-bootstrap/action.yaml b/.github/actions/checkout-submodules-and-bootstrap/action.yaml
index df3fdff..7424ca5 100644
--- a/.github/actions/checkout-submodules-and-bootstrap/action.yaml
+++ b/.github/actions/checkout-submodules-and-bootstrap/action.yaml
@@ -26,14 +26,21 @@
with:
platform: ${{ inputs.platform }}
extra-parameters: ${{ inputs.extra-submodule-parameters }}
+ - name: Bootstrap Cache
+ uses: ./.github/actions/bootstrap-cache
- name: Bootstrap
uses: ./.github/actions/bootstrap
+ env:
+ PW_NO_CIPD_CACHE_DIR: Y
with:
platform: ${{ inputs.platform }}
- bootstrap-log-name: ${{ inputs.bootstrap-log-name }}
- name: Dump disk info after checkout submodule & Bootstrap
shell: bash
run: scripts/dump_diskspace_info.sh
+ - name: Upload Bootstrap Logs
+ uses: ./.github/actions/upload-bootstrap-logs
+ with:
+ bootstrap-log-name: ${{ inputs.bootstrap-log-name }}
- name: Work around TSAN ASLR issues
if: runner.os == 'Linux' && !env.ACT
shell: bash
diff --git a/.github/actions/upload-bootstrap-logs/action.yaml b/.github/actions/upload-bootstrap-logs/action.yaml
new file mode 100644
index 0000000..522058c
--- /dev/null
+++ b/.github/actions/upload-bootstrap-logs/action.yaml
@@ -0,0 +1,18 @@
+name: Upload bootstrap logs
+description: Upload bootstrap logs
+inputs:
+ bootstrap-log-name:
+ description: "Bootstrap log name"
+ required: false
+ default: bootstrap-logs-${{ github.job }}
+runs:
+ using: "composite"
+ steps:
+ - name: Uploading bootstrap logs
+ uses: actions/upload-artifact@v4
+ if: ${{ always() && !env.ACT }}
+ with:
+ name: ${{ inputs.bootstrap-log-name }}
+ path: |
+ .environment/gn_out/.ninja_log
+ .environment/pigweed-venv/*.log
diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml
index 919085a..1f0b7c5 100644
--- a/.github/workflows/cirque.yaml
+++ b/.github/workflows/cirque.yaml
@@ -57,7 +57,6 @@
with:
platform: linux
- # TODO: Is what's being cached here actually compatible with a regular bootstrap?
- name: Bootstrap Cache
uses: ./.github/actions/bootstrap-cache
- name: Bootstrap Cirque
diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml
index f354ce3..ee19873 100644
--- a/.github/workflows/fuzzing-build.yaml
+++ b/.github/workflows/fuzzing-build.yaml
@@ -46,8 +46,12 @@
run: |
mkdir objdir-clone || true
+ - name: Bootstrap Cache
+ uses: ./.github/actions/bootstrap-cache
- name: Bootstrap
uses: ./.github/actions/bootstrap
+ - name: Upload Bootstrap Logs
+ uses: ./.github/actions/upload-bootstrap-logs
- name: Build all-clusters-app
run: |
@@ -80,8 +84,12 @@
run: |
mkdir objdir-clone || true
+ - name: Bootstrap Cache
+ uses: ./.github/actions/bootstrap-cache
- name: Bootstrap
uses: ./.github/actions/bootstrap
+ - name: Upload Bootstrap Logs
+ uses: ./.github/actions/upload-bootstrap-logs
- name: Build all-clusters-app
run: |
diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml
index 57a1ce7..5aa38ec 100644
--- a/.github/workflows/release_artifacts.yaml
+++ b/.github/workflows/release_artifacts.yaml
@@ -39,8 +39,12 @@
uses: actions/checkout@v4
with:
ref: "${{ github.event.inputs.releaseTag }}"
+ - name: Bootstrap Cache
+ uses: ./.github/actions/bootstrap-cache
- name: Bootstrap
uses: ./.github/actions/bootstrap
+ - name: Upload Bootstrap Logs
+ uses: ./.github/actions/upload-bootstrap-logs
- name: Build
run: scripts/examples/esp_example.sh all-clusters-app
@@ -70,8 +74,12 @@
uses: actions/checkout@v4
with:
ref: "${{ github.event.inputs.releaseTag }}"
+ - name: Bootstrap Cache
+ uses: ./.github/actions/bootstrap-cache
- name: Bootstrap
uses: ./.github/actions/bootstrap
+ - name: Upload Bootstrap Logs
+ uses: ./.github/actions/upload-bootstrap-logs
- name: Build example EFR32 Lock App
run: scripts/examples/gn_silabs_example.sh examples/lock-app/efr32/
diff --git a/scripts/setup/bootstrap.sh b/scripts/setup/bootstrap.sh
index d723e86..1b81321 100644
--- a/scripts/setup/bootstrap.sh
+++ b/scripts/setup/bootstrap.sh
@@ -21,14 +21,14 @@
# figure out additional pip install items
while [ $# -gt 0 ]; do
case $1 in
- -p | --platform)
- _SETUP_PLATFORM=$2
- shift # argument
- shift # value
- ;;
- *)
- shift
- ;;
+ -p | --platform)
+ _SETUP_PLATFORM=$2
+ shift # argument
+ shift # value
+ ;;
+ *)
+ shift
+ ;;
esac
done
@@ -41,7 +41,7 @@
for platform in ${_SETUP_PLATFORM}; do
# Allow none as an alias of nothing extra installed (like -p none)
- if [ "$platform" != "none" -a -e "$_CHIP_ROOT/scripts/setup/requirements.$platform.txt" ]; then
+ if [ "$platform" != "none" ]; then
echo "Installing pip requirements for $platform..."
pip install -q \
-r "$_CHIP_ROOT/scripts/setup/requirements.$platform.txt" \
@@ -66,7 +66,7 @@
local _BOOTSTRAP_NAME="${_BOOTSTRAP_PATH##*/}"
local _BOOTSTRAP_DIR="${_BOOTSTRAP_PATH%/*}"
# Strip off the 'scripts[/setup]' directory, leaving the root of the repo.
- _CHIP_ROOT="$(cd "${_BOOTSTRAP_DIR%/setup}/.." >/dev/null && pwd)"
+ _CHIP_ROOT="$(cd "${_BOOTSTRAP_DIR%/setup}/.." > /dev/null && pwd)"
local _CONFIG_FILE="scripts/setup/environment.json"
diff --git a/scripts/setup/requirements.silabs.txt b/scripts/setup/requirements.silabs_docker.txt
similarity index 100%
rename from scripts/setup/requirements.silabs.txt
rename to scripts/setup/requirements.silabs_docker.txt