-
Notifications
You must be signed in to change notification settings - Fork 12
202 lines (178 loc) · 7.17 KB
/
e2e.yaml
File metadata and controls
202 lines (178 loc) · 7.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#
# Copyright (C) 2026 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
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Dedicated step to build the quadlet extension image
build-container:
name: Build Extension Image
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build Image and Extract Files
id: build-image
run: |
podman build -t local_image ./
CONTAINER_ID=$(podman create localhost/local_image --entrypoint "")
mkdir -p output/plugins
podman export $CONTAINER_ID | tar -x -C output/plugins/
podman rm -f $CONTAINER_ID
podman rmi -f localhost/local_image:latest
- name: Upload Quadlet Image Artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: quadlet-plugin
path: output/plugins/
e2e:
name: e2e tests smoke / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: build-container
strategy:
fail-fast: true
matrix:
os: [ windows-2025, ubuntu-24.04 ]
env:
SKIP_INSTALLATION: true
EXTENSION_PREINSTALLED: true
PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop
# by default playwright cache browsers binaries in ~/.cache/ms-playwright on Linux and %USERPROFILE%\AppData\Local\ms-playwright on Windows
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/podman-desktop/pw-browsers
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# ==============================================
# Installing Podman
# ==============================================
- name: Install Podman
uses: redhat-actions/podman-install@256b8c40fdcb0b494704d72e325ce635d255ff8e
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
ubuntu-version: '24.04'
# ==============================================
# Installing Podman Desktop
# ==============================================
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
name: Install pnpm
with:
run_install: false
# Install Node.js
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
cache: 'pnpm'
# Install npm packages for quadlet extension
- name: Execute pnpm in Podman Quadlet Extension
run: pnpm install
# Extract @podman-desktop/api version used (and store to $GITHUB_OUTPUT)
- name: Extract @podman-desktop/api version
id: pd-api-version
shell: bash
run: |
# Using pnpm list to get the resolved version (E.g. getting 1.15.0 when ^1.15.0)
export PD_VERSION=$(pnpm list -C packages/backend/ --json | jq -r '.[0].devDependencies."@podman-desktop/api".version')
echo "PD_VERSION=$PD_VERSION" >> $GITHUB_OUTPUT
echo "Using @podman-desktop/api $PD_VERSION"
# Check cache for existing podman-desktop
- name: Cache Podman Desktop
id: cache-pd
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ${{ github.workspace }}/podman-desktop
key: pd-${{ steps.pd-api-version.outputs.PD_VERSION }}-${{ runner.os }}
# Download Podman Desktop repository based on version defined in package.json
- name: Download Podman Desktop
if: steps.cache-pd.outputs.cache-hit != 'true'
shell: bash
env:
PD_VERSION: ${{ steps.pd-api-version.outputs.PD_VERSION }}
run: |
echo "Downloading PD desktop to ${{ github.workspace }}/podman-desktop"
# Stable release are available podman-desktop/podman-desktop
# Prerelease are available under podman-desktop/prereleases
if [[ "$PD_VERSION" =~ - ]]; then
curl -sL "https://github.com/podman-desktop/prereleases/archive/refs/tags/v$PD_VERSION.tar.gz" | tar xvz
else
curl -sL "https://github.com/podman-desktop/podman-desktop/archive/refs/tags/v$PD_VERSION.tar.gz" | tar xvz
fi
# Move the extracted folder to the podman-desktop folder
mv podman-desktop-$PD_VERSION/ podman-desktop/
# Install and build podman-desktop
- name: Install pnpm deps and build Podman Desktop
if: steps.cache-pd.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{ github.workspace }}/podman-desktop
run: |
pnpm install
pnpm test:e2e:build
# Install the quadlet extension
- name: Download Quadlet Plugins
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: quadlet-plugin
path: tests/playwright/tests/playwright/output/pd-extension-quadlet-tests/plugins/
- name: Run E2E Smoke tests
shell: bash
run: pnpm test:e2e:smoke
env:
ELECTRON_DISABLE_SANDBOX: '1'
NODE_OPTIONS: --no-experimental-strip-types
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: e2e-results-${{ matrix.os }}
path: |
tests/playwright/output/
tests/playwright/tests/
- name: Upload screenshots
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: e2e-screenshots-${{ matrix.os }}
path: tests/playwright/screenshots/
upload-screenshots-argos:
name: Upload screenshots to Argos
runs-on: ubuntu-latest
needs: e2e
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: 24
cache: 'pnpm'
- name: Download all screenshots
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: e2e-screenshots-*
path: tests/playwright/screenshots
merge-multiple: true
- name: Execute pnpm install
run: pnpm install
- name: Upload screenshots to argos-ci
shell: bash
working-directory: tests/playwright
run: pnpm run argos-ci:upload