From 0a38c1281781ce4297dbcfaa15359dbbe838aa56 Mon Sep 17 00:00:00 2001 From: Sunny Date: Wed, 13 Oct 2021 18:41:13 +0530 Subject: [PATCH] workflows/e2e: Use buildkit local cache Signed-off-by: Sunny --- .github/workflows/e2e.yaml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 1e412814..2979f3e3 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -28,6 +28,14 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- + - name: Cache Docker layers + uses: actions/cache@v2 + id: cache + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-ghcache-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx-ghcache- - name: Setup Go uses: actions/setup-go@v2 with: @@ -53,7 +61,18 @@ jobs: exit 1 fi - name: Build container image - run: make docker-build IMG=test/kustomize-controller:latest BUILD_PLATFORMS=linux/amd64 BUILD_ARGS=--load + run: | + make docker-build IMG=test/kustomize-controller:latest \ + BUILD_PLATFORMS=linux/amd64 \ + BUILD_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache \ + --cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max" + - # Temp fix + # https://github.com/docker/build-push-action/issues/252 + # https://github.com/moby/buildkit/issues/1896 + name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache - name: Load test image run: kind load docker-image test/kustomize-controller:latest - name: Install CRDs