From 701f95407d09c84870b297a51346aee408e9d3e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 14 Feb 2024 10:50:34 +0200 Subject: [PATCH] zig cache fixes --- .bazelrc | 2 ++ .github/workflows/ci.yaml | 27 +++++++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.bazelrc b/.bazelrc index beffe3f4..7144d1d9 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,5 @@ +try-import %workspace%/.bazelrc.ci + test --sandbox_default_allow_network=false test --test_output=errors diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 12876f11..1026601b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,34 +22,41 @@ jobs: with: fetch-depth: 0 fetch-tags: true + - uses: actions/cache@v4 name: "Windows: cache bazelisk and zig-cache" if: runner.os == 'Windows' with: - key: cache-${{ runner.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }} + key: cache-${{ matrix.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }} path: | - 'C:\Temp\hermetic_cc_toolchain' - '~\AppData\Local\bazelisk' + C:\Temp\hermetic_cc_toolchain + ~\AppData\Local\bazelisk' + - uses: actions/cache@v4 name: "MacOS: cache bazelisk and zig-cache" if: runner.os == 'macOS' with: - key: cache-${{ runner.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }} + key: cache-${{ matrix.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }} path: | - '/tmp/zig-cache' - '~/Library/Caches/bazelisk' + /tmp/zig-cache + ~/Library/Caches/bazelisk + - uses: actions/cache@v4 name: "Linux: cache bazelisk and zig-cache" - if: runner.os == 'macOS' + if: runner.os == 'Linux' with: - key: cache-${{ runner.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }} + key: cache-${{ matrix.os }}-${{ hashFiles('.bazelversion', 'toolchain/private/zig_sdk.bzl', '.github/workflows/ci.yaml') }} path: | - '/tmp/zig-cache' - '~/.cache/bazelisk' + /tmp/zig-cache + ~/.cache/bazelisk - run: brew install bash if: runner.os == 'macOS' + - run: echo "common --announce_rc" >> .bazelrc.ci + - run: echo "build --sandbox_add_mount_pair=C:\\Temp" >> .bazelrc.ci + if: runner.os == 'Windows' + # Linux, macOS and Windows - run: ci/list_toolchains_platforms - run: ci/zig-utils