summaryrefslogtreecommitdiff
path: root/tools/ci.sh
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2024-12-10 15:34:12 +1100
committerAngus Gratton <gus@projectgus.com>2024-12-18 15:11:01 +1100
commit92a5ea51b456e96332f703aded4be2fbc22982fc (patch)
tree18d3ca02e807df8bf587854f17c7a5eb033e72c2 /tools/ci.sh
parentd10cda66dcff1b760ebc550c7f9352220fe4163f (diff)
ci: Cache Zephyr workspace installation.
Can save several minutes downloading the Zephyr docker image and/or cloning repo from GitHub. Cache keyed on the Zephyr version, which AFAIK is the only determinant for the workspace contents. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'tools/ci.sh')
-rwxr-xr-xtools/ci.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/ci.sh b/tools/ci.sh
index 33559d339..bc013f532 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -747,14 +747,24 @@ ZEPHYR_SDK_VERSION=0.16.8
ZEPHYR_VERSION=v3.7.0
function ci_zephyr_setup {
- docker pull zephyrprojectrtos/ci:${ZEPHYR_DOCKER_VERSION}
+ IMAGE=zephyrprojectrtos/ci:${ZEPHYR_DOCKER_VERSION}
+
+ docker pull ${IMAGE}
+
+ # Directories cached by GitHub Actions, mounted
+ # into the container
+ ZEPHYRPROJECT_DIR="$(pwd)/zephyrproject"
+
+ mkdir -p "${ZEPHYRPROJECT_DIR}"
+
docker run --name zephyr-ci -d -it \
-v "$(pwd)":/micropython \
+ -v "${ZEPHYRPROJECT_DIR}":/zephyrproject \
-e ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-${ZEPHYR_SDK_VERSION} \
-e ZEPHYR_TOOLCHAIN_VARIANT=zephyr \
-e ZEPHYR_BASE=/zephyrproject/zephyr \
-w /micropython/ports/zephyr \
- zephyrprojectrtos/ci:${ZEPHYR_DOCKER_VERSION}
+ ${IMAGE}
docker ps -a
# qemu-system-arm is needed to run the test suite.