podman-desktop/.github/workflows/e2e-main.yaml
Evžen Gasta 2b83c13578
feat: bumped up to node 24 and electron 40 (#15119)
Signed-off-by: Evzen Gasta <evzen.ml@seznam.cz>
2025-12-23 09:32:13 +00:00

390 lines
15 KiB
YAML

#
# Copyright (C) 2023-2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: e2e-tests-main
on:
push:
branches: [main]
workflow_dispatch:
inputs:
organization:
default: 'podman-desktop'
description: 'Organization of the Podman Desktop repository'
type: string
required: true
repositoryName:
default: 'podman-desktop'
description: 'Podman Desktop repository name'
type: string
required: true
npm_target:
default: 'test:e2e'
description: 'The npm target to run tests. Use "test:e2e:all" to run all test suites, including Kubernetes tests.'
type: string
required: true
branch:
default: 'main'
description: 'Podman Desktop repo branch'
type: string
required: true
kind_provider:
description: 'Kind cluster provider type'
type: choice
options:
- docker
- podman
required: false
update_with_extensions:
description: 'Installation extensions before update'
type: choice
options:
- 'false'
- 'true'
required: false
update_target_owner:
description: 'Owner field of the update target in app-update.yml'
type: string
default: 'podman-desktop'
required: false
update_target_repo:
description: 'Repo field of the update target in app-update.yml'
type: string
default: 'testing-prereleases'
required: false
update_prerelease:
description: 'Update to the prerelease GH release'
type: choice
options:
- 'true'
- 'false'
default: 'true'
required: false
permissions:
contents: read
jobs:
e2e-tests:
name: Run All E2E tests
runs-on: ubuntu-24.04
# disable on forks as secrets are not available
if: github.event.repository.fork == false
permissions:
checks: write # required for mikepenz/action-junit-report
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: ${{ github.event.inputs.organization }}/${{ github.event.inputs.repositoryName }}
ref: ${{ github.event.inputs.branch }}
if: github.event_name == 'workflow_dispatch'
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
if: github.event_name == 'push'
- name: Set the default env. variables
env:
DEFAULT_NPM_TARGET: 'test:e2e'
DEFAULT_KIND_PROVIDER: 'docker'
run: |
echo "NPM_TARGET=${{ github.event.inputs.npm_target || env.DEFAULT_NPM_TARGET }}" >> $GITHUB_ENV
echo "KIND_PROVIDER=${{ github.event.inputs.kind_provider || env.DEFAULT_KIND_PROVIDER }}" >> $GITHUB_ENV
- name: Install Podman v5 using external action
# Use the action from the other repository
uses: redhat-actions/podman-install@15cb93f5a6b78a758fd8f4d1cecbf6651d4bcea3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup testenv using external action
uses: podman-desktop/e2e/.github/actions/pde2e-testenv-prepare@13e2c57c759137bfc1f437f221967461e8a98e2a
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 24
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Run E2E tests in Production Mode
env:
PODMANDESKTOP_CI_BOT_TOKEN: ${{ secrets.PODMANDESKTOP_CI_BOT_TOKEN }}
TEST_PODMAN_MACHINE: 'true'
SKIP_KIND_INSTALL: 'true'
KIND_PROVIDER_GHA: ${{ env.KIND_PROVIDER }}
ELECTRON_ENABLE_INSPECT: true
run: |
echo "Compiling the Podman Desktop in production mode"
pnpm compile:current --linux dir
path=$(realpath ./dist/linux-unpacked/podman-desktop)
echo "Podman Desktop built binary: $path"
export PODMAN_DESKTOP_BINARY=$path
pnpm ${{ env.NPM_TARGET }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@e08919a3b1fb83a78393dfb775a9c37f17d8eea6 # v6.0.1
if: always() # always run even if the previous step fails
with:
fail_on_failure: true
include_passed: true
detailed_summary: true
annotate_only: true
require_tests: true
report_paths: '**/*results.xml'
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: e2e-tests
path: |
./tests/**/output/
!./tests/**/traces/raw
win-update-e2e-test:
name: ${{ matrix.os }} update e2e tests - ${{ matrix.installation }}
runs-on: ${{ matrix.os }}
# disable on forks as secrets are not available
if: github.event.repository.fork == false
permissions:
checks: write # required for mikepenz/action-junit-report
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
installation: ['vanilla', 'custom-extensions']
os: [windows-2025, windows-11-arm]
exclude:
- installation: ${{ (github.event.inputs.update_with_extensions && github.event.inputs.update_with_extensions == 'true') && 'N/A' || 'custom-extensions' }}
steps:
- name: Set the default env. variables
env:
DEFAULT_UPDATE_TARGET_OWNER: 'podman-desktop'
DEFAULT_UPDATE_TARGET_REPO: 'testing-prereleases'
DEFAULT_UPDATE_PRERELEASE: 'true'
run: |
echo "UPDATE_TARGET_OWNER=${{ github.event.inputs.update_target_owner || env.DEFAULT_UPDATE_TARGET_OWNER }}" >> $env:GITHUB_ENV
echo "UPDATE_TARGET_REPO=${{ github.event.inputs.update_target_repo || env.DEFAULT_UPDATE_TARGET_REPO }}" >> $env:GITHUB_ENV
echo "UPDATE_PRERELEASE=${{ github.event.inputs.update_prerelease || env.DEFAULT_UPDATE_PRERELEASE }}" >> $env:GITHUB_ENV
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: ${{ github.event.inputs.organization }}/${{ github.event.inputs.repositoryName }}
ref: ${{ github.event.inputs.branch }}
if: github.event_name == 'workflow_dispatch'
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
if: github.event_name == 'push'
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 24
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Adjust/Downgrade local podman desktop version Windows
run: node tests/playwright/scripts/version-util.cjs ./package.json --update
- name: Build Podman Desktop locally, win nsis, ${{ env.UPDATE_PRERELEASE == 'true' && 'Allow Prerelease' || 'Using Latest' }}
env:
ELECTRON_ENABLE_INSPECT: true
run: |
if ($env:UPDATE_PRERELEASE -eq 'true') {
$updaterFile = "packages/main/src/plugin/updater.ts"
if (-Not (Test-Path $updaterFile)) {
Write-Error "Updater file not found at $updaterFile"
} else {
Write-host "Allow Prerelease when updating, setting it inline in the code"
(Get-Content $updaterFile).Replace('autoUpdater.autoDownload = false;', 'autoUpdater.autoDownload = false;autoUpdater.allowPrerelease=true;') | Set-Content $updaterFile -ErrorAction Stop
}
}
pnpm compile:current --win nsis
$runnerArch=$env:RUNNER_ARCH
$unpackedPath = "dist/win-unpacked"
if ($runnerArch -eq 'ARM64') {
$unpackedPath = "dist/win-arm64-unpacked"
}
echo ("PD_DIST_PATH=" + $unpackedPath) >> $env:GITHUB_ENV
$path=("./$unpackedPath/Podman Desktop.exe" | resolve-path).ProviderPath
echo $path
echo ("PODMAN_DESKTOP_BINARY=" + $path) >> $env:GITHUB_ENV
- name: Manually set update target owner/repo ${{ env.UPDATE_TARGET_OWNER }}/${{ env.UPDATE_TARGET_REPO }}
run: |
$updateFile = "$env:PD_DIST_PATH/resources/app-update.yml"
if (-Not (Test-Path $updateFile)) {
Write-Error "app-update.yml not found at $updateFile"
}
(Get-Content $updateFile).Replace('owner: podman-desktop', "owner: " + $env:UPDATE_TARGET_OWNER) |
Set-Content -ErrorAction Stop $updateFile
(Get-Content $updateFile).Replace('repo: podman-desktop', "repo: " + $env:UPDATE_TARGET_REPO) |
Set-Content -ErrorAction Stop $updateFile
echo "Show app-update.yml after replace..."
cat "$env:PD_DIST_PATH/resources/app-update.yml"
- name: Run E2E Update test
env:
INSTALLATION_TYPE: ${{ matrix.installation }}
run: |
echo "${{ env.PODMAN_DESKTOP_BINARY }}"
echo "${{ env.INSTALLATION_TYPE }}"
pnpm test:e2e:update:run
- name: Publish Test Report
uses: mikepenz/action-junit-report@e08919a3b1fb83a78393dfb775a9c37f17d8eea6 # v6.0.1
if: always() # always run even if the previous step fails
with:
fail_on_failure: true
include_passed: true
detailed_summary: true
annotate_only: true
require_tests: true
report_paths: '**/*results.xml'
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: ${{ matrix.os }}-update-e2e-test-${{ matrix.installation }}
path: |
./tests/**/output/
!./tests/**/traces/raw
mac-update-e2e-test:
name: ${{ matrix.os }} update e2e tests
strategy:
fail-fast: false
matrix:
os: [macos-26, macos-15-intel]
runs-on: ${{ matrix.os }}
# disable on forks as secrets are not available
if: github.event.repository.fork == false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 60
steps:
- name: Set the default env. variables
env:
DEFAULT_UPDATE_TARGET_OWNER: 'podman-desktop'
DEFAULT_UPDATE_TARGET_REPO: 'testing-prereleases'
DEFAULT_UPDATE_PRERELEASE: 'true'
run: |
echo "UPDATE_TARGET_OWNER=${{ github.event.inputs.update_target_owner || env.DEFAULT_UPDATE_TARGET_OWNER }}" >> $GITHUB_ENV
echo "UPDATE_TARGET_REPO=${{ github.event.inputs.update_target_repo || env.DEFAULT_UPDATE_TARGET_REPO }}" >> $GITHUB_ENV
echo "UPDATE_PRERELEASE=${{ github.event.inputs.update_prerelease || env.DEFAULT_UPDATE_PRERELEASE }}" >> $GITHUB_ENV
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: ${{ github.event.inputs.organization }}/${{ github.event.inputs.repositoryName }}
ref: ${{ github.event.inputs.branch }}
if: github.event_name == 'workflow_dispatch'
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
if: github.event_name == 'push'
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: 24
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Adjust/Downgrade local podman desktop version
run: |
node tests/playwright/scripts/version-util.cjs ./package.json --update
actualVersion=$(jq -r '.version' package.json)
echo "PD_VERSION=$actualVersion" >> $GITHUB_ENV
- name: Build Podman Desktop locally, mac dmg, ${{ env.UPDATE_PRERELEASE == 'true' && 'Allow Prerelease' || 'Using Latest' }}
env:
ELECTRON_ENABLE_INSPECT: true
run: |
if [[ "${{ env.UPDATE_PRERELEASE }}" == "true" ]]; then
echo "Allow Prerelease when updating, setting it inline in the code"
sed -i '' '/autoUpdater.autoDownload = false;/a \
autoUpdater.allowPrerelease = true; \
' packages/main/src/plugin/updater.ts
fi
pnpm compile:current --mac dmg
dmgPath=$(realpath $(find ./dist -name "*.dmg"))
echo "DMG Path: $dmgPath"
# extract the dmg
hdiutil attach $dmgPath
pdVolumePath=$(find /Volumes -name "*${{ env.PD_VERSION }}*")
echo "PD Volume path: $pdVolumePath"
sudo cp -R "$pdVolumePath/Podman Desktop.app" /Applications
# codesign the extracted app
appPath="/Applications/Podman Desktop.app"
sudo codesign --force --deep --sign - "$appPath"
codesign --verify --deep --verbose=2 "$appPath"
binaryPath="$appPath/Contents/MacOS/Podman Desktop"
echo "PD_APP_PATH=$appPath" >> $GITHUB_ENV
echo "PODMAN_DESKTOP_BINARY=$binaryPath" >> $GITHUB_ENV
- name: Manually set update target owner/repo ${{ env.UPDATE_TARGET_OWNER }}/${{ env.UPDATE_TARGET_REPO }}
run: |
echo "Replace app-update.yml repo to a testing-prerelease"
sudo sed -i '' 's/owner: podman-desktop/owner: ${{ env.UPDATE_TARGET_OWNER}}/' "$PD_APP_PATH/Contents/Resources/app-update.yml"
sudo sed -i '' 's/repo: podman-desktop/repo: ${{ env.UPDATE_TARGET_REPO}}/' "$PD_APP_PATH/Contents/Resources/app-update.yml"
echo "Show app-update.yml after replace..."
cat "$PD_APP_PATH/Contents/Resources/app-update.yml"
- name: Run E2E Update test
env:
UPDATE_PODMAN_DESKTOP: true
run: |
echo "${{ env.PODMAN_DESKTOP_BINARY }}"
pnpm test:e2e:update:run
- name: Publish Test Report
uses: mikepenz/action-junit-report@e08919a3b1fb83a78393dfb775a9c37f17d8eea6 # v6.0.1
if: always() # always run even if the previous step fails
with:
fail_on_failure: true
include_passed: true
detailed_summary: true
annotate_only: true
require_tests: true
report_paths: '**/*results.xml'
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: always()
with:
name: ${{ matrix.os }}-update-e2e-test
path: |
./tests/**/output/
!./tests/**/traces/raw