From 19bf298f07055aa3658d652b8e7a1f9e8b98387c Mon Sep 17 00:00:00 2001 From: Adrian Riobo Lorenzo Date: Tue, 9 Jan 2024 16:39:48 -0500 Subject: [PATCH] test syntax --- .github/workflows/all.yml | 81 ++++++++++++++++++++++++++--------- .github/workflows/builder.yml | 10 ++--- .github/workflows/tester.yml | 13 ++++++ 3 files changed, 79 insertions(+), 25 deletions(-) diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 1887864..6cc11ea 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -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 @@ -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 @@ -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 @@ -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 }}' \ @@ -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: | @@ -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 - - \ No newline at end of file diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 5952d98..3233349 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -1,10 +1,10 @@ name: builder -on: - push: - branches: - - "main" - pull_request: {} +# on: +# push: +# branches: +# - "main" +# pull_request: {} env: OCI_E2E_NAME: libhvee-e2e diff --git a/.github/workflows/tester.yml b/.github/workflows/tester.yml index 7e5e2de..1e2687a 100644 --- a/.github/workflows/tester.yml +++ b/.github/workflows/tester.yml @@ -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: |