forked from containers/libhvee
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a11499e
commit fc085c1
Showing
1 changed file
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
name: all | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: {} | ||
|
||
env: | ||
OCI_E2E_NAME: libhvee-e2e | ||
|
||
jobs: | ||
build-oci-e2e: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
|
||
- 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 }} | ||
- name: Upload e2e flat image as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.OCI_E2E_NAME }}-v${{ github.sha }} | ||
path: ${{ env.OCI_E2E_NAME }}.tar | ||
|
||
build-executables: | ||
runs-on: windows-2022 | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
|
||
- 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@v3 | ||
with: | ||
name: libhvee-v${{ github.sha }} | ||
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 | ||
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: | ||
# 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 | ||
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_KEY='${{ secrets.AZURE_STORAGE_KEY }}' \ | ||
quay.io/rhqp/qenvs:v0.6.1 azure \ | ||
windows create \ | ||
--project-name 'windows-desktop' \ | ||
--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: 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_KEY='${{ secrets.AZURE_STORAGE_KEY }}' \ | ||
quay.io/rhqp/qenvs:v0.6.1 azure \ | ||
windows destroy \ | ||
--project-name 'windows-desktop' \ | ||
--backed-url azblob://qenvs-state/${{ github.sha }} | ||
# Check logs | ||
podman logs -f windows-destroy | ||