Skip to content

Commit

Permalink
test syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianriobo committed Jan 9, 2024
1 parent 0ba704b commit 19bf298
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 25 deletions.
81 changes: 61 additions & 20 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,38 @@ on:

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@v3
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=${{ github.sha }} make build-oci-e2e
podman save -o ${{ env.OCI_E2E_NAME }}.tar quay.io/rhqp/${{ env.OCI_E2E_NAME}}:v${{ github.sha }}
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@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.OCI_E2E_NAME }}-v${{ github.sha }}
path: ${{ env.OCI_E2E_NAME }}.tar
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@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
Expand All @@ -49,14 +50,12 @@ jobs:
run: make build

- name: Upload libhvee executables as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: libhvee-v${{ github.sha }}
name: libhvee-v${{ env.CORRELATE }}
path: bin/*.exe

e2e-windows-destkop:
# TODO remove When moved to upstream needs will be removed
# as job will be executed from a workflow_run
needs:
- build-oci-e2e
- build-executables
Expand All @@ -73,8 +72,6 @@ jobs:
windows-featurepack: '22h2-ent'

steps:
# When moving to be executed on upstream we need to save the context
# to try match the ${{ github.sha }} or some other correlation value
- name: Create instance
run: |
# Create instance
Expand All @@ -88,7 +85,7 @@ jobs:
-e AZURE_STORAGE_KEY='${{ secrets.AZURE_STORAGE_KEY }}' \
quay.io/rhqp/qenvs:v0.6.1 azure \
windows create \
--project-name 'windows-desktop' \
--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 }}' \
Expand All @@ -107,6 +104,52 @@ jobs:
-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: |
Expand All @@ -121,9 +164,7 @@ jobs:
-e AZURE_STORAGE_KEY='${{ secrets.AZURE_STORAGE_KEY }}' \
quay.io/rhqp/qenvs:v0.6.1 azure \
windows destroy \
--project-name 'windows-desktop' \
--project-name 'windows-desktop-${{ matrix.windows-version }}-${{ matrix.windows-featurepack }}' \
--backed-url azblob://qenvs-state/${{ github.sha }}
# Check logs
podman logs -f windows-destroy
10 changes: 5 additions & 5 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: builder

on:
push:
branches:
- "main"
pull_request: {}
# on:
# push:
# branches:
# - "main"
# pull_request: {}

env:
OCI_E2E_NAME: libhvee-e2e
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ jobs:
-o ServerAliveCountMax=1200 \
$(cat username)@$(cat host) "systeminfo"
- name: Download e2e flat image as artifact
id: download-images-artifact
uses: dawidd6/action-download-artifact@v3
with:
# workflow_conclusion: completed
# workflow: build-tests.yml
name: libhvee-e2e-v${{ github.sha }}

- name: Run libhvee e2e
run: |
# load libhvee-e2e image from tar file
podman load -i libhvee-e2e.tar
- name: Destroy instance
if: always()
run: |
Expand Down

0 comments on commit 19bf298

Please sign in to comment.