From 775cca8347604aa159e497f4435490781eabd9a6 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Tue, 27 Aug 2024 11:38:08 +0100 Subject: [PATCH] testing gha workaround --- .github/workflows/test-gha.yml | 56 ++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-gha.yml b/.github/workflows/test-gha.yml index 6106d596..03fe4759 100644 --- a/.github/workflows/test-gha.yml +++ b/.github/workflows/test-gha.yml @@ -13,21 +13,45 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 id: builder1 - # - uses: crazy-max/ghaction-github-runtime@v3 - # - run: cd openssl-cross-docker-build && - # mkdir -p output/ && - # docker build --progress=plain - # --builder ${{ steps.builder1.outputs.name }} - # --cache-from=type=gha,scope=$platform - # --cache-to=type=gha,scope=$platform,mode=max - # --platform linux/arm/v7 - # --output=type=local,dest=output/ - # -t testf . - - name: Build and push Docker image - uses: docker/build-push-action@v5 + - name: Cache + uses: actions/cache@v3 + id: cache with: - context: openssl-cross-docker-build - file: openssl-cross-docker-build/Dockerfile - cache-from: type=gha - cache-to: type=gha,mode=max + path: | + usr-local-cargo-git-db + usr-local-cargo-registry-cache + usr-local-cargo-registry-index + src-target + key: cache-${{ hashFiles('openssl-cross-docker-build/Dockerfile') }} + + - name: inject cache into docker + uses: reproducible-containers/buildkit-cache-dance@v3.1.0 + with: + cache-map: | + { + "usr-local-cargo-git-db": "/usr/local/cargo/git/db", + "usr-local-cargo-registry-cache": "/usr/local/cargo/registry/cache", + "usr-local-cargo-registry-index": "/usr/local/cargo/registry/index", + "src-target": "/src/target" + } + skip-extraction: ${{ steps.cache.outputs.cache-hit }} + + - uses: crazy-max/ghaction-github-runtime@v3 + - run: cd openssl-cross-docker-build && + mkdir -p output/ && + docker build --progress=plain + --builder ${{ steps.builder1.outputs.name }} + --cache-from=type=gha,scope=$platform + --cache-to=type=gha,scope=$platform,mode=max + --platform linux/arm/v7 + --output=type=local,dest=output/ + -t testf . + + # - name: Build and push Docker image + # uses: docker/build-push-action@v5 + # with: + # context: openssl-cross-docker-build + # file: openssl-cross-docker-build/Dockerfile + # cache-from: type=gha + # cache-to: type=gha,mode=max