From 49175435fb5eb81a1e2c1a5673b6bc957933faa0 Mon Sep 17 00:00:00 2001 From: Alexander Gutkin Date: Wed, 12 May 2021 13:12:16 -0700 Subject: [PATCH] [CI] Attempt to correct the location of local Bazel cache on Windows (issue \#75). PiperOrigin-RevId: 373435674 --- .github/workflows/windows-ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 0cd003f..39e6dec 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -14,11 +14,18 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Update environment variables + # See https://docs.bazel.build/versions/master/output_directories.html + run: | + echo "BAZEL_CACHE_DIR=$env:USERPROFILE\_bazel_$env:USERNAME" >> $env:GITHUB_ENV + - name: Mount bazel cache - uses: actions/cache@v2 + # Note: Note that below the version is pinned to `v2.1.4`. This is due to + # several path bugs. See: + # https://stackoverflow.com/questions/66870002/github-actions-cache-maven-m2-repository-on-windows-environment-c-users-run + uses: actions/cache@v2.1.4 with: - # See https://docs.bazel.build/versions/master/output_directories.html - path: ${{ github.workspace }}/.cache/bazel + path: ${{ env.BAZEL_CACHE_DIR}} key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE.bazel') }} restore-keys: ${{ runner.os }}-bazel