From cea61db1d95d5c761d38a6cb3c7648c58ffca1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Fri, 1 Sep 2023 12:21:35 +0200 Subject: [PATCH] chore: build cli only once for conformance tests (#8210) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .github/workflows/conformance.yaml | 44 ++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 5b4b58d0f4..0180138f9f 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -36,6 +36,29 @@ jobs: retention-days: 1 if-no-files-found: error + prepare-cli: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + - name: Setup build env + uses: ./.github/actions/setup-build-env + timeout-minutes: 10 + with: + build-cache-key: build-cli + - name: Build CLI + shell: bash + run: | + set -e + VERSION=${{ github.ref_name }} make build-cli + - name: upload images archive + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + with: + name: kubectl-kyverno + path: cmd/cli/kubectl-kyverno/kubectl-kyverno + retention-days: 1 + if-no-files-found: error + # runs conformance test suites with configuration: standard: runs-on: ubuntu-latest @@ -432,7 +455,9 @@ jobs: # - tekton # - traefik # - velero - needs: prepare-images + needs: + - prepare-images + - prepare-cli name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }} steps: - name: Checkout kyverno/kyverno @@ -457,6 +482,16 @@ jobs: uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: kyverno.tar + - name: Download kyverno CLI archive + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: kubectl-kyverno + - name: Install Kyverno CLI + shell: bash + run: | + set -e + chmod +x kubectl-kyverno && mv kubectl-kyverno ./cmd/cli/kubectl-kyverno/kyverno + echo "$PWD/cmd/cli/kubectl-kyverno" >> $GITHUB_PATH - name: Load kyverno images archive in kind cluster shell: bash run: | @@ -470,13 +505,6 @@ jobs: make kind-install-kyverno - name: Wait for kyverno ready uses: ./.github/actions/kyverno-wait-ready - - name: Build Kyverno CLI - shell: bash - run: | - set -e - make build-cli - ln -s $PWD/cmd/cli/kubectl-kyverno/kubectl-kyverno ./cmd/cli/kubectl-kyverno/kyverno - echo "$PWD/cmd/cli/kubectl-kyverno" >> $GITHUB_PATH - name: Test policy library with kuttl shell: bash run: |