Skip to content

Podman Desktop E2E with Podman installation #523

Podman Desktop E2E with Podman installation

Podman Desktop E2E with Podman installation #523

name: Podman Desktop E2E with Podman installation
run-name: Podman Desktop E2E with Podman installation ${{ inputs.debug == 'true' && '- Debug' || '' }}
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
inputs:
fork:
default: 'podman-desktop'
description: 'Podman Desktop repo fork'
type: string
required: true
branch:
default: 'main'
description: 'Podman Desktop repo branch'
type: string
required: true
npm_target:
default: 'test:e2e'
description: 'npm target to run tests'
type: string
required: true
env_vars:
default: 'TEST_PODMAN_MACHINE=true'
description: 'Env. Variables passed into target machine'
type: 'string'
required: true
debug:
description: 'For debugging to restrict what is run'
type: choice
options:
- 'false'
- 'true'
images_version:
default: 'BUILDER="v0.0.2",PODMAN="v0.0.2",RUNNER="v0.0.2"'
description: 'Testing images versions, no spaces'
type: 'string'
required: true
podman_provider:
type: choice
description: 'Podman virtualization provider, default is wsl, alternative hyperv'
options:
- wsl
- hyperv
required: true
jobs:
windows:
timeout-minutes: 120
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
env:
MAPT_VERSION: v0.7.4
MAPT_IMAGE: quay.io/redhat-developer/mapt
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'
- windows-version: ${{ (github.event.inputs.debug && github.event.inputs.debug == 'true') && '11' || 'N/A' }}
windows-featurepack: ${{ (github.event.inputs.debug && github.event.inputs.debug == 'true') && '23h2-ent' || 'N/A' }}
steps:
- name: Set the default env. variables
env:
DEFAULT_FORK: 'podman-desktop'
DEFAULT_BRANCH: 'main'
DEFAULT_NPM_TARGET: 'test:e2e'
DEFAULT_PODMAN_PROVIDER: 'wsl'
DEFAULT_ENV_VARS: 'TEST_PODMAN_MACHINE=true'
DEFAULT_PODMAN_OPTIONS: 'INIT=1,START=1,ROOTFUL=1,NETWORKING=0'
DEFAULT_IMAGES_VERSIONS: 'BUILDER="v0.0.3",PODMAN="v0.0.3",RUNNER="v0.0.3"'
run: |
echo "FORK=${{ github.event.inputs.fork || env.DEFAULT_FORK }}" >> $GITHUB_ENV
echo "BRANCH=${{ github.event.inputs.branch || env.DEFAULT_BRANCH }}" >> $GITHUB_ENV
echo "PODMAN_PROVIDER=${{ github.event.inputs.podman_provider || env.DEFAULT_PODMAN_PROVIDER }}" >> $GITHUB_ENV
echo "NPM_TARGET=${{ github.event.inputs.npm_target || env.DEFAULT_NPM_TARGET }}" >> $GITHUB_ENV
echo "ENV_VARS=${{ github.event.inputs.env_vars || env.DEFAULT_ENV_VARS }}" >> $GITHUB_ENV
echo "${{ env.DEFAULT_PODMAN_OPTIONS }}" | awk -F ',' \
'{for (i=1; i<=NF; i++) {split($i, kv, "="); print "PODMAN_"kv[1]"="kv[2]}}' >> $GITHUB_ENV
echo "${{ github.event.inputs.images_version || env.DEFAULT_IMAGES_VERSIONS }}" | awk -F ',' \
'{for (i=1; i<=NF; i++) {split($i, kv, "="); print "PDE2E_"kv[1]"="kv[2]}}' >> $GITHUB_ENV
- 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 }}' \
${{ env.MAPT_IMAGE }}:${{ env.MAPT_VERSION }} azure \
windows create \
--project-name 'windows-desktop' \
--backed-url 'file:///workspace' \
--conn-details-output '/workspace' \
--windows-version '${{ matrix.windows-version }}' \
--windows-featurepack '${{ matrix.windows-featurepack }}' \
--vmsize 'Standard_D8s_v4' \
--tags project=podman-desktop \
--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: Emulate X session
run: |
# use fake rdp to emulate an active x session
podman run -d --name x-session \
-e RDP_HOST=$(cat host) \
-e RDP_USER=$(cat username) \
-e RDP_PASSWORD=$(cat userpassword) \
quay.io/rhqp/frdp:v0.0.1
# Wait until the x session has been created
podman wait --condition running x-session
# Check logs for the x session
podman logs x-session
- name: Build Podman Desktop locally
run: |
podman run -d --name pde2e-builder-run \
-e TARGET_HOST=$(cat host) \
-e TARGET_HOST_USERNAME=$(cat username) \
-e TARGET_HOST_KEY_PATH=/data/id_rsa \
-e TARGET_FOLDER=pd-e2e \
-e TARGET_RESULTS=results \
-e TARGET_CLEANUP=false \
-e OUTPUT_FOLDER=/data \
-e DEBUG=true \
-v $PWD:/data:z \
quay.io/odockal/pde2e-builder:${{ env.PDE2E_BUILDER }}-windows \
pd-e2e/builder.ps1 \
-targetFolder pd-e2e \
-resultsFolder results \
-fork ${{ env.FORK }} \
-branch ${{ env.BRANCH }}
# check logs
podman logs -f pde2e-builder-run
- name: Install Podman via Podman Desktop using GOAX
run: |
cat results/pde2e-binary-path.log | awk '{print $1}'
# Run e2e tests
podman run --rm -d --name pd-e2e-windows \
-e TARGET_HOST=$(cat host) \
-e TARGET_HOST_USERNAME=$(cat username) \
-e TARGET_HOST_KEY_PATH=/data/id_rsa \
-e TARGET_FOLDER=pd-e2e \
-e TARGET_RESULTS=pd-e2e-results \
-e TARGET_CLEANUP=false \
-e OUTPUT_FOLDER=/data \
-e DEBUG=true \
-v $PWD:/data:z \
quay.io/rhqp/podman-desktop-e2e:v1.1.0-windows-amd64 \
pd-e2e/run.ps1 \
-targetFolder pd-e2e \
-wslInstallFix 'true' \
-junitResultsFilename pd-e2e-results.xml \
-pdPath "$(cat results/pde2e-binary-path.log | tr '\n' " ")" \
-resultsFolder pd-e2e-results
# Check logs
podman logs -f pd-e2e-windows
- name: Run Podman Desktop Playwright E2E tests
if: ${{ !github.event.inputs.debug || github.event.inputs.debug == 'false' }}
env:
PODMANDESKTOP_CI_BOT_TOKEN: ${{ secrets.PODMANDESKTOP_CI_BOT_TOKEN }}
run: |
echo "PODMANDESKTOP_CI_BOT_TOKEN=${PODMANDESKTOP_CI_BOT_TOKEN}" > secrets.txt
podman run -d --name pde2e-runner-run \
-e TARGET_HOST=$(cat host) \
-e TARGET_HOST_USERNAME=$(cat username) \
-e TARGET_HOST_KEY_PATH=/data/id_rsa \
-e TARGET_FOLDER=pd-e2e \
-e TARGET_RESULTS=results \
-e OUTPUT_FOLDER=/data \
-e DEBUG=true \
-v $PWD:/data:z \
-v $PWD/secrets.txt:/opt/pde2e-runner/secrets.txt:z \
quay.io/odockal/pde2e-runner:${{ env.PDE2E_RUNNER }}-windows \
pd-e2e/runner.ps1 \
-targetFolder pd-e2e \
-resultsFolder results \
-fork ${{ env.FORK }} \
-branch ${{ env.BRANCH }} \
-npmTarget ${{ env.NPM_TARGET }} \
-initialize ${{ env.PODMAN_INIT }} \
-rootful ${{ env.PODMAN_ROOTFUL }} \
-start ${{ env.PODMAN_START }} \
-userNetworking ${{ env.PODMAN_NETWORKING }} \
-podmanProvider ${{ env.PODMAN_PROVIDER }} \
-envVars ${{ env.ENV_VARS }} \
-secretFile secrets.txt
# check logs
podman logs -f pde2e-runner-run
- 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 }}' \
${{ env.MAPT_IMAGE }}:${{ env.MAPT_VERSION }} azure \
windows destroy \
--project-name 'windows-desktop' \
--backed-url 'file:///workspace'
# Check logs
podman logs -f windows-destroy
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always() # always run even if the previous step fails
with:
fail_on_failure: true
include_passed: true
detailed_summary: true
require_tests: true
report_paths: '**/*results.xml'
- name: Upload test artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: results-e2e-${{ matrix.windows-version }}${{ matrix.windows-featurepack }}
path: |
results/*
pd-e2e-results/*