Skip to content

chore: add gh action builder flow fix #80 #1

chore: add gh action builder flow fix #80

chore: add gh action builder flow fix #80 #1

Workflow file for this run

name: all
on:
push:
branches:
- "main"
pull_request:
env:
OCI_E2E_NAME: libhvee-e2e
CORRELATE: ${{ github.sha }}
jobs:
build-oci-e2e:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Build and archive e2e image
# use github.sha as ID to correlate various workflows triggered by the same event
run: |
VERSION=${{ env.CORRELATE}} make build-oci-e2e
podman save -o ${{ env.OCI_E2E_NAME }}.tar quay.io/rhqp/${{ env.OCI_E2E_NAME}}:v${{ env.CORRELATE }}
- name: Upload e2e flat image as artifact
uses: actions/upload-artifact@v4
with:
name: libhvee-e2e-v${{ env.CORRELATE }}
path: libhvee-e2e.tar
build-executables:
runs-on: windows-2022
strategy:
fail-fast: false
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.18'
- name: Build libhvee executables
run: make build
- name: Upload libhvee executables as artifact
uses: actions/upload-artifact@v4
with:
name: libhvee-v${{ env.CORRELATE }}
path: bin/*.exe
e2e-windows-destkop:
needs:
- build-oci-e2e
- build-executables
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
windows-version: ['10','11']
windows-featurepack: ['22h2-ent', '23h2-ent']
exclude:
- windows-version: '10'
windows-featurepack: '23h2-ent'
- windows-version: '11'
windows-featurepack: '22h2-ent'
steps:
- name: Create instance
run: |
# Create instance
podman run -d --name windows-create --rm \
-v ${PWD}:/workspace:z \
-e ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} \
-e ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }} \
-e ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} \
-e ARM_CLIENT_SECRET='${{ secrets.ARM_CLIENT_SECRET }}' \
-e AZURE_STORAGE_ACCOUNT='${{ secrets.AZURE_STORAGE_ACCOUNT }}' \
-e AZURE_STORAGE_KEY='${{ secrets.AZURE_STORAGE_KEY }}' \
quay.io/rhqp/qenvs:v0.6.1 azure \
windows create \
--project-name 'windows-desktop-${{ matrix.windows-version }}-${{ matrix.windows-featurepack }}' \
--backed-url azblob://qenvs-state/${{ github.sha }} \
--conn-details-output '/workspace' \
--windows-version '${{ matrix.windows-version }}' \
--windows-featurepack '${{ matrix.windows-featurepack }}' \
--tags org=containers,project=libhvee,origin=ghaction \
--spot
# Check logs
podman logs -f windows-create
- name: Check instance system info
run: |
ssh -i id_rsa \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
-o ServerAliveInterval=30 \
-o ServerAliveCountMax=1200 \
$(cat username)@$(cat host) "systeminfo"
- name: Download libhvee artifacts
id: download-libhvee-artifacts
uses: actions/download-artifact@v4
- name: Run libhvee e2e
run: |
# Load image from artifact
podman load -i libhvee-e2e-v${{ env.CORRELATE }}/libhvee-e2e.tar
# Run container
podman run --rm -d --name libhvee-e2e \
-v $PWD:/workspace:z \
-v $PWD/libhvee-v${{ env.CORRELATE }}/createvm.exe:/opt/libhvee-e2e/createvm.exe:z \
-v $PWD/libhvee-v${{ env.CORRELATE }}/dumpvms.exe:/opt/libhvee-e2e/dumpvms.exe:z \
-v $PWD/libhvee-v${{ env.CORRELATE }}/kvpctl.exe:/opt/libhvee-e2e/kvpctl.exe:z \
-v $PWD/libhvee-v${{ env.CORRELATE }}/updatevm.exe:/opt/libhvee-e2e/updatevm.exe:z \
-e PLATFORM=windows \
-e TARGET_HOST=$(cat host) \
-e TARGET_HOST_USERNAME=$(cat username) \
-e TARGET_HOST_KEY_PATH=/workspace/id_rsa \
-e TARGET_FOLDER=libhvee-e2e \
-e TARGET_RESULTS=libhvee-e2e.xml \
-e OUTPUT_FOLDER=/workspace \
-e DEBUG=true \
quay.io/rhqp/libhvee-e2e:v${{ env.CORRELATE }} \
libhvee-e2e/run.ps1 \
-targetFolder libhvee-e2e \
-junitResultsFilename libhvee-e2e.xml
# Check logs
podman logs -f libhvee-e2e
- name: Evaluate libhvee e2e results
uses: mikepenz/action-junit-report@v4
with:
fail_on_failure: true
include_passed: true
detailed_summary: true
require_tests: true
report_paths: libhvee-e2e.xml
- name: Upload libhvee e2e results
uses: actions/upload-artifact@v4
with:
name: libhvee-e2e-${{ matrix.windows-version }}${{ matrix.windows-featurepack }}
path: libhvee-e2e.xml
- name: Destroy instance
if: always()
run: |
# Destroy instance
podman run -d --name windows-destroy --rm \
-v ${PWD}:/workspace:z \
-e ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} \
-e ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }} \
-e ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} \
-e ARM_CLIENT_SECRET='${{ secrets.ARM_CLIENT_SECRET }}' \
-e AZURE_STORAGE_ACCOUNT='${{ secrets.AZURE_STORAGE_ACCOUNT }}' \
-e AZURE_STORAGE_KEY='${{ secrets.AZURE_STORAGE_KEY }}' \
quay.io/rhqp/qenvs:v0.6.1 azure \
windows destroy \
--project-name 'windows-desktop-${{ matrix.windows-version }}-${{ matrix.windows-featurepack }}' \
--backed-url azblob://qenvs-state/${{ github.sha }}
# Check logs
podman logs -f windows-destroy