Skip to content

Commit 9b05a9d

Browse files
authored
Create e2e-main.yaml
1 parent 8803dc0 commit 9b05a9d

File tree

1 file changed

+119
-0
lines changed

1 file changed

+119
-0
lines changed

.github/workflows/e2e-main.yaml

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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 Podman Desktop 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: 'Podman Desktop Extension SSO repo branch'
39+
type: string
40+
required: true
41+
42+
jobs:
43+
e2e-tests:
44+
name: Run E2E tests
45+
runs-on: ubuntu-22.04
46+
steps:
47+
- uses: actions/checkout@v4
48+
if: github.event_name == 'workflow_dispatch'
49+
with:
50+
repository: ${{ github.event.inputs.organization }}/${{ github.event.inputs.repositoryName }}
51+
ref: ${{ github.event.inputs.branch }}
52+
path: ${{ github.event.inputs.repositoryName }}
53+
54+
- uses: actions/checkout@v4
55+
if: github.event_name == 'push'
56+
with:
57+
path: podman-desktop-redhat-account-ext
58+
59+
# Checkout podman desktop
60+
- uses: actions/checkout@v4
61+
with:
62+
repository: containers/podman-desktop
63+
ref: main
64+
path: podman-desktop
65+
66+
- uses: actions/setup-node@v4
67+
with:
68+
node-version: 20
69+
70+
- name: Update podman
71+
run: |
72+
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"
73+
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/Release.key" | sudo apt-key add -
74+
sudo apt-get update -qq
75+
sudo apt-get -qq -y install podman || { echo "Start fallback steps for podman nightly installation from a static mirror" && \
76+
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" && \
77+
curl -L "http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/Release.key" | sudo apt-key add - && \
78+
sudo apt-get update && \
79+
sudo apt-get -y install podman; }
80+
podman version
81+
# downgrade conmon package version to workaround issue with starting containers, see https://github.com/containers/conmon/issues/475
82+
# remove once the repository contains conmon 2.1.10
83+
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
84+
sudo apt install /tmp/conmon_2.1.2.deb
85+
86+
- name: Build Podman Desktop for E2E tests
87+
working-directory: ./podman-desktop
88+
run: |
89+
yarn --frozen-lockfile
90+
yarn test:e2e:build
91+
92+
- name: Get yarn cache directory path
93+
working-directory: ./podman-desktop-redhat-account-ext
94+
id: yarn-cache-dir-path
95+
run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT}
96+
97+
- uses: actions/cache@v4
98+
id: yarn-cache
99+
with:
100+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
101+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
102+
restore-keys: |
103+
${{ runner.os }}-yarn-
104+
105+
- name: Execute yarn in SSO Extension
106+
working-directory: ./podman-desktop-redhat-account-ext
107+
run: yarn --frozen-lockfile
108+
109+
- name: Run All E2E tests
110+
working-directory: ./podman-desktop-redhat-account-ext
111+
env:
112+
PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop
113+
run: yarn test:e2e
114+
115+
- uses: actions/upload-artifact@v4
116+
if: always()
117+
with:
118+
name: e2e-tests
119+
path: ./**/tests/output/

0 commit comments

Comments
 (0)