From e3f633a39a41f2000096a3999ebf23e49d50fd4c Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 1 Mar 2024 19:41:58 +0100 Subject: [PATCH] ci: Use path-based git context This avoids redundant clones and gives more stable file permissions when copying in during the container build. We just need to move the test outputs outside of the git repo. Signed-off-by: Jan Kiszka --- .github/workflows/master.yml | 2 ++ .github/workflows/next.yml | 12 ++++++++++-- .github/workflows/release.yml | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 5ffc4cc5..edf308da 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -31,6 +31,7 @@ jobs: uses: docker/build-push-action@v5 if: ${{ env.PUSH_MASTER }} with: + context: . cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 @@ -40,6 +41,7 @@ jobs: uses: docker/build-push-action@v5 if: ${{ env.PUSH_MASTER }} with: + context: . cache-from: type=gha cache-to: type=gha,mode=max target: kas-isar diff --git a/.github/workflows/next.yml b/.github/workflows/next.yml index ff5e3013..bba5dccb 100644 --- a/.github/workflows/next.yml +++ b/.github/workflows/next.yml @@ -76,6 +76,7 @@ jobs: - name: Build kas image uses: docker/build-push-action@v5 with: + context: . cache-from: type=gha cache-to: type=gha,mode=max load: true @@ -83,10 +84,13 @@ jobs: - name: Test kas image run: | cd image-tests/poky - KAS_IMAGE_VERSION=next ../../kas-container build kas.yml + export KAS_IMAGE_VERSION=next + export KAS_WORK_DIR=~/poky-test + ../../kas-container build kas.yml - name: Complete build and deploy kas image uses: docker/build-push-action@v5 with: + context: . cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 @@ -95,6 +99,7 @@ jobs: - name: Build kas-isar image uses: docker/build-push-action@v5 with: + context: . cache-from: type=gha cache-to: type=gha,mode=max target: kas-isar @@ -103,10 +108,13 @@ jobs: - name: Test kas-isar image run: | cd image-tests/isar - KAS_IMAGE_VERSION=next ../../kas-container build kas.yml + export KAS_IMAGE_VERSION=next + export KAS_WORK_DIR=~/isar-test + ../../kas-container build kas.yml - name: Complete build and deploy kas-isar image uses: docker/build-push-action@v5 with: + context: . cache-from: type=gha cache-to: type=gha,mode=max target: kas-isar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70b68b1c..1ea35be0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: - name: Build kas image uses: docker/build-push-action@v5 with: + context: . cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 @@ -33,6 +34,7 @@ jobs: - name: Build kas-isar image uses: docker/build-push-action@v5 with: + context: . cache-from: type=gha cache-to: type=gha,mode=max target: kas-isar