CI: public release fetches each env's libraries inside its first build
Changelog: - Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
de9c860081
commit
77f4af1bbb
1 file changed
+14
-14
@@ -274,12 +274,11 @@ jobs:
|
|||||||
echo "::error::$title failed: ${failed[*]}"
|
echo "::error::$title failed: ${failed[*]}"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
# 1) install. Nothing is cached here (reproducible), so each run
|
# 1) install the platforms. Nothing is cached here (reproducible),
|
||||||
# downloads the platforms, toolchains and libraries: 8 minutes when
|
# so each run downloads platforms, toolchains and libraries: 8 min
|
||||||
# done env by env. One env per distinct platform (+ platform_packages)
|
# env by env up front. One env per distinct platform (+
|
||||||
# installs those first, one at a time -- they are shared, concurrent
|
# platform_packages) installs those first, one at a time -- they
|
||||||
# installs would race in ~/.platformio. The other envs then only add
|
# are shared in ~/.platformio, concurrent installs would race.
|
||||||
# their libraries, each into its own .pio/libdeps/<env>: in parallel.
|
|
||||||
envs=$(printf '%s\n' "${arts[@]}" | while read -r a; do echo "${spec[$a]%%|*}"; done | sort -u)
|
envs=$(printf '%s\n' "${arts[@]}" | while read -r a; do echo "${spec[$a]%%|*}"; done | sort -u)
|
||||||
mapfile -t first < <(pio project config --json-output | python3 -c '
|
mapfile -t first < <(pio project config --json-output | python3 -c '
|
||||||
import json, sys
|
import json, sys
|
||||||
@@ -294,16 +293,17 @@ jobs:
|
|||||||
t0=$SECONDS
|
t0=$SECONDS
|
||||||
for env in "${first[@]}"; do par install "install-$env"; done
|
for env in "${first[@]}"; do par install "install-$env"; done
|
||||||
report "install" "${first[@]/#/install-}"
|
report "install" "${first[@]/#/install-}"
|
||||||
rest=()
|
echo "installed ${#first[@]} platforms in $((SECONDS - t0)) s"
|
||||||
for env in $envs; do [[ " ${first[*]} " == *" $env "* ]] || rest+=("install-$env"); done
|
# 2) compile, each artifact into its own build dir (one env comes in
|
||||||
par install "${rest[@]}"
|
# up to four flag sets). An env's libraries come with its first
|
||||||
report "install" "${rest[@]}"
|
# build, into its own .pio/libdeps/<env>, while other envs compile:
|
||||||
echo "installed $(wc -w <<<"$envs") envs (${#first[@]} platforms first) in $((SECONDS - t0)) s"
|
# the lock keeps its other flag sets from installing them at once.
|
||||||
# 2) compile, each artifact into its own build dir: one env comes in
|
locks="$RUNNER_TEMP/locks"
|
||||||
# up to four flag sets
|
mkdir -p "$locks"
|
||||||
compile() {
|
compile() {
|
||||||
local env flags suffix variant
|
local env flags suffix variant
|
||||||
IFS='|' read -r env flags suffix variant <<<"${spec[$1]}"
|
IFS='|' read -r env flags suffix variant <<<"${spec[$1]}"
|
||||||
|
flock "$locks/$env" pio pkg install -e "$env" || return 1
|
||||||
export FW_OTA_VARIANT=$variant PLATFORMIO_BUILD_DIR="$bdir/$1" PLATFORMIO_BUILD_FLAGS="$PUB_FLAGS $flags"
|
export FW_OTA_VARIANT=$variant PLATFORMIO_BUILD_DIR="$bdir/$1" PLATFORMIO_BUILD_FLAGS="$PUB_FLAGS $flags"
|
||||||
pio run -j "$PIO_JOBS" -e "$env" || return 1
|
pio run -j "$PIO_JOBS" -e "$env" || return 1
|
||||||
[ -f "$bdir/$1/$env/firmware.zip" ] || pio run -j "$PIO_JOBS" -t mergebin -e "$env" # ESP32
|
[ -f "$bdir/$1/$env/firmware.zip" ] || pio run -j "$PIO_JOBS" -t mergebin -e "$env" # ESP32
|
||||||
@@ -312,7 +312,7 @@ jobs:
|
|||||||
par compile "${arts[@]}"
|
par compile "${arts[@]}"
|
||||||
echo "compiled ${#arts[@]} artifacts in $((SECONDS - t1)) s ($PARALLEL at a time)"
|
echo "compiled ${#arts[@]} artifacts in $((SECONDS - t1)) s ($PARALLEL at a time)"
|
||||||
report "build" "${arts[@]}"
|
report "build" "${arts[@]}"
|
||||||
# 2) package in order: manifest.json, deltas and the version are
|
# 3) package in order: manifest.json, deltas and the version are
|
||||||
# written one artifact at a time. The OTA tools read .pio/build/<env>,
|
# written one artifact at a time. The OTA tools read .pio/build/<env>,
|
||||||
# so that points at the artifact being packaged.
|
# so that points at the artifact being packaged.
|
||||||
mkdir -p .pio/build
|
mkdir -p .pio/build
|
||||||
|
|||||||
Reference in new issue
Block a user