From e583fc333b0fa384cbb0f74f69b7db8024e5c563 Mon Sep 17 00:00:00 2001 From: KubeSaw Date: Tue, 29 Jul 2025 13:23:34 +0100 Subject: [PATCH] add actions to be used in UI e2e tests --- publish-operators-for-ui-e2e-tests/action.yml | 53 +++++++++++++++++++ .../action.yml | 53 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 publish-operators-for-ui-e2e-tests/action.yml create mode 100644 publish-sandbox-ui-for-ui-e2e-tests/action.yml diff --git a/publish-operators-for-ui-e2e-tests/action.yml b/publish-operators-for-ui-e2e-tests/action.yml new file mode 100644 index 0000000..7dc00f0 --- /dev/null +++ b/publish-operators-for-ui-e2e-tests/action.yml @@ -0,0 +1,53 @@ +name: 'Publish Current Toolchain Operators (Host & Member) for UI e2e Tests' +description: 'An action that publishes the current version of Toolchain Operators as single releases for UI e2e Tests' +inputs: + quay-token: + description: Quay token + required: true + quay-namespace: + description: Quay namespace + required: false + default: codeready-toolchain + sha: + description: PR head sha + default: ${{ github.event.pull_request.head.sha }} + required: false + pr-number: + description: Number of the PR + default: ${{ github.event.pull_request.number }} + required: false + author: + description: Author of the PR + default: ${{ github.event.pull_request.head.user.login }} + required: false + gh-head-ref: + description: Branch name the PR was opened from + default: ${{ github.event.pull_request.head.ref }} + required: false +runs: + using: "composite" + steps: + - name: Login to quay + shell: bash + run: | + set -e + export XDG_RUNTIME_DIR=/run/user/${UID} + mkdir -p ${XDG_RUNTIME_DIR}/containers || true + echo "{ + \"auths\": { + \"quay.io\": { + \"auth\": \"${{ inputs.quay-token }}\" + } + } + }"> ${XDG_RUNTIME_DIR}/containers/auth.json + + podman login --get-login quay.io + + - name: Publish current bundle for UI e2e Tests + shell: bash + run: | + PROVIDED_REF=${{ inputs.gh-head-ref }} + if [[ -n ${PROVIDED_REF} ]]; then + GH_HEAD_REF_PARAM="GITHUB_HEAD_REF=${PROVIDED_REF}" + fi + make publish-current-bundles-for-e2e QUAY_NAMESPACE=${{ inputs.quay-namespace }} IMAGE_BUILDER=podman PULL_PULL_SHA=${{ inputs.sha }} PULL_NUMBER=${{ inputs.pr-number }} AUTHOR=${{ inputs.author }} ${GH_HEAD_REF_PARAM} ENVIRONMENT=ui-e2e-tests diff --git a/publish-sandbox-ui-for-ui-e2e-tests/action.yml b/publish-sandbox-ui-for-ui-e2e-tests/action.yml new file mode 100644 index 0000000..ae3b39b --- /dev/null +++ b/publish-sandbox-ui-for-ui-e2e-tests/action.yml @@ -0,0 +1,53 @@ +name: 'Publish Current Developer Sandbox UI' +description: 'An action that publishes the current version of Developer Sandbox UI' +inputs: + quay-token: + description: Quay token + required: true + quay-namespace: + description: Quay namespace + required: false + default: codeready-toolchain + sha: + description: PR head sha + default: ${{ github.event.pull_request.head.sha }} + required: false + pr-number: + description: Number of the PR + default: ${{ github.event.pull_request.number }} + required: false + author: + description: Author of the PR + default: ${{ github.event.pull_request.head.user.login }} + required: false + gh-head-ref: + description: Branch name the PR was opened from + default: ${{ github.event.pull_request.head.ref }} + required: false +runs: + using: "composite" + steps: + - name: Login to quay + shell: bash + run: | + set -e + export XDG_RUNTIME_DIR=/run/user/${UID} + mkdir -p ${XDG_RUNTIME_DIR}/containers || true + echo "{ + \"auths\": { + \"quay.io\": { + \"auth\": \"${{ inputs.quay-token }}\" + } + } + }"> ${XDG_RUNTIME_DIR}/containers/auth.json + + podman login --get-login quay.io + + - name: Publish current Developer Sandbox UI + shell: bash + run: | + PROVIDED_REF=${{ inputs.gh-head-ref }} + if [[ -n ${PROVIDED_REF} ]]; then + GH_HEAD_REF_PARAM="GITHUB_HEAD_REF=${PROVIDED_REF}" + fi + make push-sandbox-plugin QUAY_NAMESPACE=${{ inputs.quay-namespace }} IMAGE_BUILDER=podman PULL_PULL_SHA=${{ inputs.sha }} PULL_NUMBER=${{ inputs.pr-number }} AUTHOR=${{ inputs.author }} GITHUB_BRANCH="${PROVIDED_REF}" ${GH_HEAD_REF_PARAM}