updated the runner to utilize caching
CI / Detect changed paths (pull_request) Successful in 11s
CI / Odin unit tests and build (pull_request) Successful in 1m18s
CI / API unit tests and lint (pull_request) Has been skipped
CI / Infra unit tests, vet, and preview (pull_request) Successful in 1m13s

This commit is contained in:
2026-09-06 14:08:13 -06:00
parent d227296e77
commit 53cc4ee321
3 changed files with 42 additions and 6 deletions
+9
View File
@@ -66,6 +66,15 @@ jobs:
with: with:
submodules: recursive submodules: recursive
# Cache the extracted Odin install so only the first run downloads the
# ~60 MB tarball; keyed on the pinned version (cache paths live outside
# the checkout, so no sharing between jobs/refs).
- name: Cache Odin
uses: actions/cache@v4
with:
path: /tmp/odin
key: odin-${{ env.ODIN_VERSION }}-${{ runner.arch }}
- name: Install Odin ${{ env.ODIN_VERSION }} - name: Install Odin ${{ env.ODIN_VERSION }}
run: scripts/install_odin.sh run: scripts/install_odin.sh
+18
View File
@@ -34,6 +34,12 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: Cache Odin
uses: actions/cache@v4
with:
path: /tmp/odin
key: odin-${{ env.ODIN_VERSION }}-${{ runner.arch }}
- name: Install Odin ${{ env.ODIN_VERSION }} - name: Install Odin ${{ env.ODIN_VERSION }}
run: scripts/install_odin.sh run: scripts/install_odin.sh
@@ -76,6 +82,12 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: Cache Odin
uses: actions/cache@v4
with:
path: /tmp/odin
key: odin-${{ env.ODIN_VERSION }}-${{ runner.arch }}
- name: Install Odin ${{ env.ODIN_VERSION }} - name: Install Odin ${{ env.ODIN_VERSION }}
run: scripts/install_odin.sh run: scripts/install_odin.sh
@@ -139,6 +151,12 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: Cache Odin
uses: actions/cache@v4
with:
path: /tmp/odin
key: odin-${{ env.ODIN_VERSION }}-${{ runner.arch }}
- name: Install Odin ${{ env.ODIN_VERSION }} - name: Install Odin ${{ env.ODIN_VERSION }}
run: scripts/install_odin.sh run: scripts/install_odin.sh
+11 -2
View File
@@ -18,10 +18,19 @@ case "$ARCH" in
;; ;;
esac esac
# If a prior job restored the install from cache, reuse it instead of
# re-downloading. The extracted Odin binary already on PATH is authoritative;
# otherwise fetch the version (plus the raylib workaround) fresh.
if [ -x /tmp/odin/odin ]; then
echo "Odin ${VERSION} found in cache (host arch: ${ARCH}, release arch: ${OBJ_ARCH})"
BIN_DIR=/tmp/odin
else
curl -fL -o /tmp/odin.tar.gz \ curl -fL -o /tmp/odin.tar.gz \
"https://github.com/odin-lang/Odin/releases/download/${VERSION}/odin-linux-${OBJ_ARCH}-${VERSION}.tar.gz" "https://github.com/odin-lang/Odin/releases/download/${VERSION}/odin-linux-${OBJ_ARCH}-${VERSION}.tar.gz"
mkdir -p /tmp/odin mkdir -p /tmp/odin
tar -xzf /tmp/odin.tar.gz -C /tmp/odin --strip-components=1 tar -xzf /tmp/odin.tar.gz -C /tmp/odin --strip-components=1
BIN_DIR=/tmp/odin
fi
# Work around an Odin binding bug: for ODIN_ARCH == .arm64 the vendored # Work around an Odin binding bug: for ODIN_ARCH == .arm64 the vendored
# raylib references `vendor/raylib/linux-arm/libraylib.a`, but the release # raylib references `vendor/raylib/linux-arm/libraylib.a`, but the release
@@ -33,7 +42,7 @@ if [ "${OBJ_ARCH}" = "arm64" ] \
fi fi
if [ -n "${GITHUB_PATH:-}" ]; then if [ -n "${GITHUB_PATH:-}" ]; then
echo "/tmp/odin" >> "$GITHUB_PATH" echo "${BIN_DIR}" >> "$GITHUB_PATH"
fi fi
echo "Installed Odin ${VERSION} (host arch: ${ARCH}, release arch: ${OBJ_ARCH})" echo "Odin ${VERSION} ready (host arch: ${ARCH}, release arch: ${OBJ_ARCH})"