Skip to content

Commit

Permalink
actions: take test image from artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
jsliacan committed Dec 4, 2023
1 parent c4d0d4c commit dca935b
Showing 1 changed file with 40 additions and 17 deletions.
57 changes: 40 additions & 17 deletions .github/workflows/windows-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
types:
- completed

env:
REGISTRY: ghcr.io

jobs:
windows:
runs-on: ubuntu-latest
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -81,25 +102,24 @@ 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
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 \
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Expand Down

0 comments on commit dca935b

Please sign in to comment.