updated the runner to utilize caching
This commit is contained in:
@@ -66,6 +66,15 @@ jobs:
|
||||
with:
|
||||
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 }}
|
||||
run: scripts/install_odin.sh
|
||||
|
||||
|
||||
@@ -34,6 +34,12 @@ jobs:
|
||||
with:
|
||||
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 }}
|
||||
run: scripts/install_odin.sh
|
||||
|
||||
@@ -76,6 +82,12 @@ jobs:
|
||||
with:
|
||||
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 }}
|
||||
run: scripts/install_odin.sh
|
||||
|
||||
@@ -139,6 +151,12 @@ jobs:
|
||||
with:
|
||||
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 }}
|
||||
run: scripts/install_odin.sh
|
||||
|
||||
|
||||
+15
-6
@@ -18,10 +18,19 @@ case "$ARCH" in
|
||||
;;
|
||||
esac
|
||||
|
||||
curl -fL -o /tmp/odin.tar.gz \
|
||||
"https://github.com/odin-lang/Odin/releases/download/${VERSION}/odin-linux-${OBJ_ARCH}-${VERSION}.tar.gz"
|
||||
mkdir -p /tmp/odin
|
||||
tar -xzf /tmp/odin.tar.gz -C /tmp/odin --strip-components=1
|
||||
# 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 \
|
||||
"https://github.com/odin-lang/Odin/releases/download/${VERSION}/odin-linux-${OBJ_ARCH}-${VERSION}.tar.gz"
|
||||
mkdir -p /tmp/odin
|
||||
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
|
||||
# raylib references `vendor/raylib/linux-arm/libraylib.a`, but the release
|
||||
@@ -33,7 +42,7 @@ if [ "${OBJ_ARCH}" = "arm64" ] \
|
||||
fi
|
||||
|
||||
if [ -n "${GITHUB_PATH:-}" ]; then
|
||||
echo "/tmp/odin" >> "$GITHUB_PATH"
|
||||
echo "${BIN_DIR}" >> "$GITHUB_PATH"
|
||||
fi
|
||||
|
||||
echo "Installed Odin ${VERSION} (host arch: ${ARCH}, release arch: ${OBJ_ARCH})"
|
||||
echo "Odin ${VERSION} ready (host arch: ${ARCH}, release arch: ${OBJ_ARCH})"
|
||||
|
||||
Reference in New Issue
Block a user