Skip to content

Commit

Permalink
Merge pull request #161 from motiejus/cache-dirs
Browse files Browse the repository at this point in the history
zig cache fixes
  • Loading branch information
motiejus-wix authored Feb 14, 2024
2 parents 9ab5590 + 701f954 commit 0a55405
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
try-import %workspace%/.bazelrc.ci

test --sandbox_default_allow_network=false
test --test_output=errors

Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a55405

Please sign in to comment.