|
85 | 85 |
|
86 | 86 | - name: Run unit tests
|
87 | 87 | run: yarn test
|
| 88 | + |
| 89 | + e2e-tests: |
| 90 | + name: e2e tests |
| 91 | + runs-on: ubuntu-24.04 |
| 92 | + needs: test |
| 93 | + env: |
| 94 | + SKIP_INSTALLATION: true |
| 95 | + steps: |
| 96 | + - uses: actions/checkout@v4 |
| 97 | + with: |
| 98 | + path: podman-desktop-redhat-account-ext |
| 99 | + - uses: actions/setup-node@v4 |
| 100 | + with: |
| 101 | + node-version: 20 |
| 102 | + |
| 103 | + # Checkout podman desktop |
| 104 | + - uses: actions/checkout@v4 |
| 105 | + with: |
| 106 | + repository: containers/podman-desktop |
| 107 | + ref: main |
| 108 | + path: podman-desktop |
| 109 | + |
| 110 | + - name: Update podman |
| 111 | + run: | |
| 112 | + # ubuntu version from kubic repository to install podman we need (v5) |
| 113 | + ubuntu_version='23.04' |
| 114 | + sudo sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" |
| 115 | + curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add - |
| 116 | + # install necessary dependencies for criu package which is not part of 23.04 |
| 117 | + sudo apt-get install -qq libprotobuf32t64 python3-protobuf libnet1 |
| 118 | + # install criu manually from static location |
| 119 | + curl -sLO http://cz.archive.ubuntu.com/ubuntu/pool/universe/c/criu/criu_3.16.1-2_amd64.deb && sudo dpkg -i criu_3.16.1-2_amd64.deb |
| 120 | + sudo apt-get update -qq |
| 121 | + sudo apt-get -qq -y install podman || { echo "Start fallback steps for podman nightly installation from a static mirror" && \ |
| 122 | + sudo sh -c "echo 'deb http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" && \ |
| 123 | + curl -L "http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add - && \ |
| 124 | + sudo apt-get update && \ |
| 125 | + sudo apt-get -y install podman; } |
| 126 | + podman version |
| 127 | +
|
| 128 | + - name: Revert unprivileged user namespace restrictions in Ubuntu 24.04 |
| 129 | + run: | |
| 130 | + # allow unprivileged user namespace |
| 131 | + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 |
| 132 | +
|
| 133 | + - name: Build Podman Desktop for E2E tests |
| 134 | + working-directory: ./podman-desktop |
| 135 | + run: | |
| 136 | + yarn --frozen-lockfile |
| 137 | + yarn test:e2e:build |
| 138 | +
|
| 139 | + - name: Get yarn cache directory path |
| 140 | + working-directory: ./podman-desktop-redhat-account-ext |
| 141 | + id: yarn-cache-dir-path |
| 142 | + run: echo "dir=$(yarn cache dir)" >> ${GITHUB_OUTPUT} |
| 143 | + |
| 144 | + - uses: actions/cache@v4 |
| 145 | + id: yarn-cache |
| 146 | + with: |
| 147 | + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} |
| 148 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 149 | + restore-keys: | |
| 150 | + ${{ runner.os }}-yarn- |
| 151 | +
|
| 152 | + - name: Ensure getting current HEAD version of the test framework |
| 153 | + working-directory: ./podman-desktop-redhat-account-ext |
| 154 | + run: yarn add -D @podman-desktop/tests-playwright@next |
| 155 | + |
| 156 | + - name: Execute yarn in SSO Extension |
| 157 | + working-directory: ./podman-desktop-redhat-account-ext |
| 158 | + run: yarn --frozen-lockfile |
| 159 | + |
| 160 | + - name: Build SSO extension from container file |
| 161 | + working-directory: ./podman-desktop-redhat-account-ext |
| 162 | + run: | |
| 163 | + yarn build |
| 164 | + podman build -t local_sso_image ./ |
| 165 | + CONTAINER_ID=$(podman create localhost/local_sso_image --entrypoint "") |
| 166 | + podman export $CONTAINER_ID > /tmp/local_sso_image.tar |
| 167 | + mkdir -p tests/output/sso-tests-pd/plugins |
| 168 | + tar -xf /tmp/local_sso_image.tar -C tests/output/sso-tests-pd/plugins/ |
| 169 | + |
| 170 | + - name: Run All E2E tests |
| 171 | + working-directory: ./podman-desktop-redhat-account-ext |
| 172 | + env: |
| 173 | + PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop |
| 174 | + run: yarn test:e2e |
| 175 | + |
| 176 | + - uses: actions/upload-artifact@v4 |
| 177 | + if: always() |
| 178 | + with: |
| 179 | + name: e2e-tests |
| 180 | + path: ./**/tests/output/ |
0 commit comments