From 15b13f0f41bc86f89ab0879ed3c3ef4d8090b9e2 Mon Sep 17 00:00:00 2001 From: KevFan Date: Wed, 18 Oct 2023 10:10:31 +0100 Subject: [PATCH] workflow: re-add smoke test --- .github/workflows/build-image.yaml | 24 +++++++----------------- .github/workflows/e2e.yaml | 4 ++-- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 53ccdb02..c687e12c 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -36,11 +36,11 @@ jobs: images: | ${{ env.IMG_REGISTRY_HOST}}/${{ env.IMG_REGISTRY_ORG }}/limitador tags: | + type=raw,value=${{ github.sha }} # set latest tag for main branch type=raw,value=latest,enable=${{ github.ref_name == env.MAIN_BRANCH_NAME }} # set branch name tag for non-main branches type=raw,value=${{ github.ref_name }},enable=${{ github.ref_name != env.MAIN_BRANCH_NAME }} - type=sha - name: Login to container registry uses: docker/login-action@v2 with: @@ -55,22 +55,12 @@ jobs: tags: ${{ steps.meta.outputs.tags }} build-args: | GITHUB_SHA=${{ github.sha }} - cache-from: type=gha - cache-to: type=gha,mode=max -# - name: Build Image -# id: build-image -# uses: redhat-actions/buildah-build@v2 -# with: -# image: limitador -# tags: ${{ env.IMG_TAGS }} -# platforms: linux/amd64,linux/arm64 -# dockerfiles: | -# ./Dockerfile -# build-args: | -# GITHUB_SHA=${{ github.sha }} -# - name: Smoke Test -# run: | -# podman run --rm -t ${{ steps.build-image.outputs.image }}:${{ github.sha }} limitador-server --help + cache-from: type=gha,scope=${{ matrix.platform == 'linux/amd64' && 'build-amd' || 'build-arm'}} + cache-to: type=gha,mode=max,scope=${{ matrix.platform == 'linux/amd64' && 'build-amd' || 'build-arm'}} + load: true + - name: Smoke Test + run: | + docker run --rm -t ${{ env.IMG_REGISTRY_HOST}}/${{ env.IMG_REGISTRY_ORG }}/limitador:${{ github.sha }} limitador-server --help # - name: Push Image # if: ${{ !env.ACT }} # id: push-to-quay diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 83af14a6..cd276d51 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -30,8 +30,8 @@ jobs: with: context: . tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=gha,scope=e2e + cache-to: type=gha,mode=max,scope=e2e load: true - name: Create k8s Kind Cluster uses: helm/kind-action@v1.8.0