|
| 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 | + schedule: |
| 22 | + - cron: '0 0 * * *' |
| 23 | + |
| 24 | + workflow_dispatch: |
| 25 | + inputs: |
| 26 | + organization: |
| 27 | + default: 'crc-org' |
| 28 | + description: 'Organization of the Podman Desktop repository' |
| 29 | + type: string |
| 30 | + required: true |
| 31 | + repositoryName: |
| 32 | + default: 'crc-extension' |
| 33 | + description: 'Podman Desktop OpenShift Local Extension repository name' |
| 34 | + type: string |
| 35 | + required: true |
| 36 | + branch: |
| 37 | + default: 'main' |
| 38 | + description: 'Podman Desktop OpenShift Local Extension repo branch' |
| 39 | + type: string |
| 40 | + required: true |
| 41 | + |
| 42 | +jobs: |
| 43 | + e2e-tests: |
| 44 | + name: Run E2E tests |
| 45 | + runs-on: ubuntu-24.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 == 'schedule' |
| 56 | + with: |
| 57 | + path: crc-extension |
| 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 | + - uses: pnpm/action-setup@v4 |
| 71 | + name: Install pnpm |
| 72 | + with: |
| 73 | + run_install: false |
| 74 | + package_json_file: ./podman-desktop/package.json |
| 75 | + |
| 76 | + - name: Execute pnpm |
| 77 | + working-directory: ./podman-desktop |
| 78 | + run: pnpm install |
| 79 | + |
| 80 | + - name: Build Podman Desktop for E2E tests |
| 81 | + working-directory: ./podman-desktop |
| 82 | + run: pnpm test:e2e:build |
| 83 | + |
| 84 | + - name: Ensure getting current HEAD version of the test framework |
| 85 | + working-directory: ./crc-extension |
| 86 | + run: | |
| 87 | + # workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712 |
| 88 | + version=$(npm view @podman-desktop/tests-playwright@next version) |
| 89 | + echo "Version of @podman-desktop/tests-playwright to be used: $version" |
| 90 | + jq --arg version "$version" '.devDependencies."@podman-desktop/tests-playwright" = $version' package.json > package.json_tmp && mv package.json_tmp package.json |
| 91 | +
|
| 92 | + - name: Execute yarn in OpenShift Local Extension |
| 93 | + working-directory: ./crc-extension |
| 94 | + run: yarn |
| 95 | + |
| 96 | + - name: Revert unprivileged user namespace restrictions in Ubuntu 24.04 |
| 97 | + run: | |
| 98 | + # allow unprivileged user namespace |
| 99 | + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 |
| 100 | + |
| 101 | + - name: Run All E2E tests |
| 102 | + working-directory: ./crc-extension |
| 103 | + env: |
| 104 | + PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop |
| 105 | + run: yarn test:e2e |
| 106 | + |
| 107 | + - uses: actions/upload-artifact@v4 |
| 108 | + if: always() |
| 109 | + with: |
| 110 | + name: e2e-tests |
| 111 | + path: ./**/tests/**/output/ |
0 commit comments