Skip to content

Commit ae07904

Browse files
authored
Merge pull request #108 from odockal/issue-107
chore(ci): add E2E test workflow
2 parents 0f5f5fe + e9daea9 commit ae07904

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

.github/workflows/e2e-main.yaml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#
2+
# Copyright (C) 2024 Red Hat, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
name: e2e-tests-main
19+
20+
on:
21+
push:
22+
branches: [main]
23+
24+
workflow_dispatch:
25+
inputs:
26+
organization:
27+
default: 'redhat-developer'
28+
description: 'Organization of the Red Hat Account Extension repository'
29+
type: string
30+
required: true
31+
repositoryName:
32+
default: 'podman-desktop-redhat-account-ext'
33+
description: 'Podman Desktop RedHat Account Extension repository name'
34+
type: string
35+
required: true
36+
branch:
37+
default: 'main'
38+
description: 'Red Hat Account Extension repo branch'
39+
type: string
40+
required: true
41+
42+
jobs:
43+
e2e-tests:
44+
name: Red Hat Account Extension E2E tests
45+
runs-on: ubuntu-22.04
46+
steps:
47+
48+
- uses: actions/checkout@v4
49+
if: github.event_name == 'workflow_dispatch'
50+
with:
51+
repository: ${{ github.event.inputs.organization }}/${{ github.event.inputs.repositoryName }}
52+
ref: ${{ github.event.inputs.branch }}
53+
path: ${{ github.event.inputs.repositoryName }}
54+
55+
- uses: actions/checkout@v4
56+
if: github.event_name == 'push'
57+
with:
58+
path: podman-desktop-redhat-account-ext
59+
60+
- name: Setup default repository name
61+
env:
62+
EVENT: ${{ github.event_name }}
63+
run: |
64+
repository=podman-desktop-redhat-account-ext
65+
if [[ "$EVENT" == 'workflow_dispatch' ]]; then
66+
repository=${{ github.event.inputs.repositoryName }}
67+
fi
68+
echo "REPOSITORY=$repository" >> $GITHUB_ENV
69+
70+
# Checkout podman desktop
71+
- uses: actions/checkout@v4
72+
with:
73+
repository: containers/podman-desktop
74+
ref: main
75+
path: podman-desktop
76+
77+
- uses: actions/setup-node@v4
78+
with:
79+
node-version: 20
80+
81+
- name: Update podman
82+
run: |
83+
sudo sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list"
84+
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/Release.key" | sudo apt-key add -
85+
sudo apt-get update -qq
86+
sudo apt-get -qq -y install podman || { echo "Start fallback steps for podman nightly installation from a static mirror" && \
87+
sudo sh -c "echo 'deb http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" && \
88+
curl -L "http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/Release.key" | sudo apt-key add - && \
89+
sudo apt-get update && \
90+
sudo apt-get -y install podman; }
91+
podman version
92+
# downgrade conmon package version to workaround issue with starting containers, see https://github.com/containers/conmon/issues/475
93+
# remove once the repository contains conmon 2.1.10
94+
wget https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/amd64/conmon_2.1.2~0_amd64.deb -O /tmp/conmon_2.1.2.deb
95+
sudo apt install /tmp/conmon_2.1.2.deb
96+
97+
- name: Build Podman Desktop for E2E tests
98+
working-directory: ./podman-desktop
99+
run: |
100+
yarn --frozen-lockfile
101+
yarn test:e2e:build
102+
103+
- name: Get yarn cache directory path
104+
working-directory: ${{ env.REPOSITORY }}
105+
id: yarn-cache-dir-path
106+
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
107+
108+
- uses: actions/cache@v4
109+
id: yarn-cache
110+
with:
111+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
112+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
113+
restore-keys: |
114+
${{ runner.os }}-yarn-
115+
116+
- name: Execute yarn in Red Hat Account Extension
117+
working-directory: ${{ env.REPOSITORY }}
118+
run: |
119+
yarn add -D @podman-desktop/tests-playwright@next
120+
yarn --frozen-lockfile
121+
122+
- name: Run All E2E tests in Red Hat Account Extension
123+
working-directory: ${{ env.REPOSITORY }}
124+
env:
125+
PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop
126+
run: yarn test:e2e
127+
128+
- uses: actions/upload-artifact@v4
129+
if: always()
130+
with:
131+
name: e2e-tests
132+
path: ./**/tests/output/

0 commit comments

Comments
 (0)