From 59a394f856108dcb33f242a61ff6e1700161b4f3 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Wed, 19 Aug 2020 17:03:21 -0700 Subject: Run bazel build before deleting cached gopath files bazel creates sysmlink to the cache on the first invokation. On a new clone, there are no symlink, thus `rm -rf bazel-bin/gopath` has no effect. Call `bazel build something` first, then delete cached gopath. PiperOrigin-RevId: 327536044 --- .github/workflows/go.yml | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.github/workflows/go.yml') diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4da3853b2..b51c22158 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -49,7 +49,12 @@ jobs: key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }} restore-keys: | ${{ runner.os }}-bazel- + # Create gopath to merge the changes. The first execution will create + # symlinks to the cache, e.g. bazel-bin. Once the cache is setup, delete + # old gopath files that may exist from previous runs (and could contain + # files that are now deleted). Then run gopath again for good. - run: | + make build TARGETS="//:gopath" rm -rf bazel-bin/gopath make build TARGETS="//:gopath" - run: tools/go_branch.sh -- cgit v1.2.3