From dca935b99966d99c3f7d22f2b92f5ad1f8cf3d6b Mon Sep 17 00:00:00 2001 From: Jakub Sliacan Date: Mon, 4 Dec 2023 14:48:44 +0100 Subject: [PATCH] actions: take test image from artifact --- .github/workflows/windows-e2e.yml | 57 ++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/.github/workflows/windows-e2e.yml b/.github/workflows/windows-e2e.yml index 2b1bfb313f..cd3ce5c2fa 100644 --- a/.github/workflows/windows-e2e.yml +++ b/.github/workflows/windows-e2e.yml @@ -6,6 +6,9 @@ on: types: - completed +env: + REGISTRY: ghcr.io + jobs: windows: runs-on: ubuntu-latest @@ -16,6 +19,31 @@ jobs: windows-featurepack: ['23h2-ent'] steps: + + - name: Download installer + id: download-installer-artifact + uses: dawidd6/action-download-artifact@v2 + with: + workflow: ${{ github.event.workflow_run.workflow_id }} + name: Windows Installer (windows-2022) + + - name: Write pull-secret + env: + PULL_SECRET: ${{ secrets.PULL_SECRET }} + run: | + echo $PULL_SECRET > pull-secret + + - name: Sleep 5min + run: | + sleep 300 + + - name: Download e2e image + id: download-images-artifact + uses: dawidd6/action-download-artifact@v2 + with: + workflow: Build test images + name: crc-e2e-pr${{ github.event.number }} + - name: Create instance run: | # Create instance @@ -47,13 +75,6 @@ jobs: -o ServerAliveCountMax=1200 \ $(cat username)@$(cat host) "systeminfo" - - name: Download installer - id: download-installer-artifact - uses: dawidd6/action-download-artifact@v2 - with: - workflow: ${{ github.event.workflow_run.workflow_id }} - name: Windows Installer (windows-2022) - - name: Install CRC on host run: | # id_rsa for the host should be in pwd @@ -81,17 +102,16 @@ jobs: # Check logs podman logs -f crc-win-support - - name: Write pull-secret - env: - PULL_SECRET: ${{ secrets.PULL_SECRET }} - run: | - echo $PULL_SECRET > pull-secret - - name: Run CRC e2e + env: + PR_NUMBER: ${{ github.event.number }} run: | # Get latest built - curl -OL https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/release-info.json - VERSION=$(jq -r '.version.crcVersion' release-info.json) + # curl -OL https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/release-info.json + # VERSION=$(jq -r '.version.crcVersion' release-info.json) + + # load crc-e2e image from tar file + podman load -i crc-e2e.tar mkdir output # id_rsa for the host should be in pwd @@ -99,7 +119,7 @@ jobs: HOST=$(cat host) USER=$(cat username) # platform tag is inferred from the image - E2E_TAGS="@basic" + E2E_TAGS="@config" TARGET_FOLDER="crc-e2e" podman run --rm -d --name crc-e2e \ @@ -112,7 +132,7 @@ jobs: -v $PWD/pull-secret:/opt/crc/pull-secret:Z \ -v $PWD/output:/output:Z \ -v $PWD/id_rsa:/opt/crc/id_rsa:Z \ - quay.io/crcont/crc-e2e:v${VERSION} \ + ${{ env.REGISTRY }}/${{ github.repository_owner }}/crc-e2e:pr-${PR_NUMBER} \ -targetFolder ${TARGET_FOLDER} \ -junitResultsPath ${TARGET_FOLDER}/junit @@ -142,6 +162,9 @@ jobs: - name: Destroy instance if: always() run: | + # Make sure lock is removed + rm -rf .poulumi/locks/* + # Destroy instance podman run -d --name windows-destroy --rm \ -v ${PWD}:/workspace:z \