diff --git a/.ci/openshift-ci/common-functions.sh b/.ci/openshift-ci/common-functions.sh index 5857a4728e..927b5cea0e 100755 --- a/.ci/openshift-ci/common-functions.sh +++ b/.ci/openshift-ci/common-functions.sh @@ -1,47 +1,47 @@ #!/bin/bash - # -# Copyright (c) 2021 Red Hat, Inc. +# Copyright (c) 2023 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ # # SPDX-License-Identifier: EPL-2.0 # +# Contributors: +# Red Hat, Inc. - initial API and implementation +# -################################ !!! IMPORTANT !!! ################################ -########### THIS JOB USE openshift ci operators workflows to run ##################### -########## More info about how it is configured can be found here: https://docs.ci.openshift.org/docs/how-tos/testing-operator-sdk-operators ############# -####################################################################################################################################################### - -# exit immediately when a command fails set -e # only exit with zero if all commands of the pipeline exit successfully set -o pipefail -export RAM_MEMORY=8192 -export TEST_POD_NAMESPACE="plugin-registry-test" -export PLUGIN_REGISTRY_IMAGE=${CHE_PLUGIN_REGISTRY} -export TEST_CONTAINER_NAME="plugins-test" -export ARTIFACTS_DIR=${ARTIFACT_DIR:-"/tmp/artifacts-che"} -export TESTS_STATUS=() -export TEST_RESULT="PASSED" -# turn off telemetry -mkdir -p "${HOME}"/.config/chectl -echo "{\"segment.telemetry\":\"off\"}" > "${HOME}"/.config/chectl/config.json +export CHE_NAMESPACE=${CHE_NAMESPACE:-"eclipse-che"} +export ARTIFACTS_DIR=${ARTIFACT_DIR:-"/tmp/artifacts"} +export CHE_FORWARDED_PORT="8081" +export OCP_ADMIN_USER_NAME=${OCP_ADMIN_USER_NAME:-"admin"} +export OCP_NON_ADMIN_USER_NAME=${OCP_NON_ADMIN_USER_NAME:-"user"} +export OCP_LOGIN_PASSWORD=${OCP_LOGIN_PASSWORD:-"passw"} +export ADMIN_CHE_NAMESPACE=${OCP_ADMIN_USER_NAME}"-che" +export USER_CHE_NAMESPACE=${OCP_NON_ADMIN_USER_NAME}"-che" +export GIT_PROVIDER_USERNAME=${GIT_PROVIDER_USERNAME:-"chepullreq1"} +export PUBLIC_REPO_WORKSPACE_NAME=${PUBLIC_REPO_WORKSPACE_NAME:-"public-repo-wksp-testname"} +export PUBLIC_PROJECT_NAME=${PUBLIC_PROJECT_NAME:-"public-repo"} +export YAML_FILE_NAME=${YAML_FILE_NAME:-"devfile.yaml"} provisionOpenShiftOAuthUser() { - htpasswd -c -B -b users.htpasswd user user + echo -e "[INFO] Provisioning Openshift OAuth user" + htpasswd -c -B -b users.htpasswd ${OCP_ADMIN_USER_NAME} ${OCP_LOGIN_PASSWORD} + htpasswd -b users.htpasswd ${OCP_NON_ADMIN_USER_NAME} ${OCP_LOGIN_PASSWORD} oc create secret generic htpass-secret --from-file=htpasswd="users.htpasswd" -n openshift-config oc apply -f ".ci/openshift-ci/htpasswdProvider.yaml" - oc adm policy add-cluster-role-to-user cluster-admin user + oc adm policy add-cluster-role-to-user cluster-admin ${OCP_ADMIN_USER_NAME} echo -e "[INFO] Waiting for htpasswd auth to be working up to 5 minutes" CURRENT_TIME=$(date +%s) ENDTIME=$((CURRENT_TIME + 300)) while [ "$(date +%s)" -lt $ENDTIME ]; do - if oc login -u user -p user --insecure-skip-tls-verify=false; then + if oc login -u=${OCP_ADMIN_USER_NAME} -p=${OCP_LOGIN_PASSWORD} --insecure-skip-tls-verify=false; then break fi sleep 10 @@ -55,19 +55,14 @@ createGithubSecret() { createCustomResourcesFile() { cat > custom-resources.yaml <<-END +apiVersion: org.eclipse.che/v2 spec: - auth: - updateAdminPassword: false - server: - pluginRegistryImage: ${PLUGIN_REGISTRY_IMAGE} - pluginRegistryPullPolicy: IfNotPresent - customCheProperties: - CHE_LIMITS_USER_WORKSPACES_RUN_COUNT: '-1' - CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT: '900000' - CHE_INFRA_KUBERNETES_WORKSPACE__UNRECOVERABLE__EVENTS: 'Failed Scheduling,Failed to pull image' - CHE_WORKSPACE_SIDECAR_IMAGE__PULL__POLICY: IfNotPresent - CHE_WORKSPACE_PLUGIN__BROKER_PULL__POLICY: IfNotPresent - CHE_INFRA_KUBERNETES_PVC_JOBS_IMAGE_PULL__POLICY: IfNotPresent + components: + pluginRegistry: + deployment: + containers: + - image: '${PLUGIN_REGISTRY_IMAGE}' + imagePullPolicy: Always END echo "Generated custom resources file" @@ -75,150 +70,131 @@ END } deployChe() { - chectl server:deploy --che-operator-cr-patch-yaml=custom-resources.yaml --platform=openshift --batch + chectl server:deploy --che-operator-cr-patch-yaml=custom-resources.yaml \ + --platform=openshift \ + --telemetry=off \ + --batch } -patchTestPodConfig(){ - TEST_USERSTORY="$1" - TEST_POD_NAME="$2" - E2E_OPENSHIFT_TOKEN="$(oc whoami -t)" - - # obtain the basic test pod config - cat .ci/openshift-ci/plugins-test-pod.yaml > plugins-test-pod.yaml - - # Patch the basic test pod config - ECLIPSE_CHE_URL=https://$(oc get route -n "eclipse-che" che -o jsonpath='{.status.ingress[0].host}') - sed -i "s@CHE_URL@${ECLIPSE_CHE_URL}@g" plugins-test-pod.yaml - sed -i "s@TEST_USERSTORY@${TEST_USERSTORY}@g" plugins-test-pod.yaml - sed -i "s@POD_NAME@${TEST_POD_NAME}@g" plugins-test-pod.yaml - sed -i "s@OCP_TOKEN@${E2E_OPENSHIFT_TOKEN}@g" plugins-test-pod.yaml - sed -i "s@GH_USERNAME@${GH_USERNAME}@g" plugins-test-pod.yaml - sed -i "s@GH_PASSWORD@${GH_PASSWORD}@g" plugins-test-pod.yaml - - cat plugins-test-pod.yaml +# this command starts port forwarding between the local machine and the che-host service in the OpenShift cluster. +forwardPortToService() { + oc port-forward service/che-host ${CHE_FORWARDED_PORT}:8080 -n ${CHE_NAMESPACE} & + sleep 3s } -downloadTestResults() { - TEST_USERSTORY="$1" - TEST_POD_NAME="$2" - mkdir -p /tmp/e2e - oc rsync -n ${TEST_POD_NAMESPACE} "${TEST_POD_NAME}":/tmp/e2e/report/ /tmp/e2e -c download-reports - oc exec -n ${TEST_POD_NAMESPACE} "${TEST_POD_NAME}" -c download-reports -- touch /tmp/e2e/done - - mkdir -p "${ARTIFACTS_DIR}" - cp -r /tmp/e2e "${ARTIFACTS_DIR}/${TEST_USERSTORY}" - rm -rf /tmp/e2e - - chectl server:logs --chenamespace="eclipse-che" --directory="${ARTIFACTS_DIR}/${TEST_USERSTORY}" - oc get checluster -o yaml -n "eclipse-che" > "${ARTIFACTS_DIR}/${TEST_USERSTORY}/che-cluster.yaml" +killProcessByPort() { + fuser -k ${CHE_FORWARDED_PORT}/tcp +} - TEST_POD_EXIT_CODE=$(oc logs -n ${TEST_POD_NAMESPACE} "${TEST_POD_NAME}" -c ${TEST_CONTAINER_NAME} | grep EXIT_CODE) +requestFactoryResolverGitRepoUrl() { + GIT_REPO_URL=$1 + CLUSTER_ACCESS_TOKEN=$(oc whoami -t) + + curl -i -X 'POST' \ + http://localhost:${CHE_FORWARDED_PORT}/api/factory/resolver \ + -H 'accept: */*' \ + -H "Authorization: Bearer ${CLUSTER_ACCESS_TOKEN}" \ + -H 'Content-Type: application/json' \ + -d '{ + "url": "'${GIT_REPO_URL}'" + }' +} - echo "The ${TEST_USERSTORY} pod exit code: ${TEST_POD_EXIT_CODE}" +testFactoryResolver() { + PUBLIC_REPO_URL=$1 - if [[ ${TEST_POD_EXIT_CODE} == "+ EXIT_CODE=1" ]]; then - echo "[ERROR] The ${TEST_USERSTORY} plugin test failed." - STATUS_MESSAGE="${TEST_USERSTORY}-------FAILED" - TESTS_STATUS+=("$STATUS_MESSAGE") - TEST_RESULT="FAILED" + echo "[INFO] Check factory resolver for public repository" + if [ "$(requestFactoryResolverGitRepoUrl ${PUBLIC_REPO_URL} | grep "HTTP/1.1 200")" ]; then + echo "[INFO] Factory resolver returned 'HTTP/1.1 200' status code." else - STATUS_MESSAGE="${TEST_USERSTORY}-------PASSED" - TESTS_STATUS+=("${STATUS_MESSAGE}") + echo "[ERROR] Factory resolver returned wrong status code. Expected: HTTP/1.1 200." + exit 1 fi - } -finishReport() { - # report test results +requestProvisionNamespace() { + CLUSTER_ACCESS_TOKEN=$(oc whoami -t) - echo "" - echo "" - echo "==================== FINISH REPORT ========================" - echo "" - - for RESULT in "${TESTS_STATUS[@]}"; do - echo " ${RESULT}" - done + curl -i -X 'POST' \ + http://localhost:${CHE_FORWARDED_PORT}/api/kubernetes/namespace/provision \ + -H 'accept: application/json' \ + -H "Authorization: Bearer ${CLUSTER_ACCESS_TOKEN}" \ + -d '' +} - if [[ ${TEST_RESULT} == "FAILED" ]]; then - echo "" - echo "[ERROR] The plugin tests failed." - echo "" - echo "===========================================================" - echo "" - echo "" +initUserNamespace() { + OCP_USER_NAME=$1 + echo "[INFO] Initialize user namespace" + oc login -u=${OCP_USER_NAME} -p=${OCP_LOGIN_PASSWORD} --insecure-skip-tls-verify=false + if [ "$(requestProvisionNamespace | grep "HTTP/1.1 200")" ]; then + echo "[INFO] Request provision user namespace returned 'HTTP/1.1 200' status code." + else + echo "[ERROR] Request provision user namespace returned wrong status code. Expected: HTTP/1.1 200" exit 1 - fi - - echo "The plugin tests successfuly passed." - echo "" - echo "===========================================================" - echo "" - echo "" - - exit 0 - } -cleanUpAfterTest(){ - TEST_POD_NAME="$1" - - # delete test pod - oc delete pod -n "${TEST_POD_NAMESPACE}" "${TEST_POD_NAME}" - - # get token - chectl auth:login -n eclipse-che - - # get workspace ID - WORKSPACE_ID=$(chectl workspace:list -n eclipse-che | grep "${TEST_POD_NAME}" | awk '{print $1}') - echo "Workspace ID: ${WORKSPACE_ID}" +testProjectIsCloned() { + PROJECT_NAME=$1 + OCP_USER_NAMESPACE=$2 - # stop workspace - chectl workspace:stop -n eclipse-che "${WORKSPACE_ID}" - - # delete workspace - chectl workspace:delete -n eclipse-che "${WORKSPACE_ID}" + WORKSPACE_POD_NAME=$(oc get pods -n ${OCP_USER_NAMESPACE} | grep workspace | awk '{print $1}') + if oc exec -it -n ${OCP_USER_NAMESPACE} ${WORKSPACE_POD_NAME} -- test -f /projects/${PROJECT_NAME}/${YAML_FILE_NAME}; then + echo "[INFO] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} exists." + else + echo "[INFO] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} is absent." + return 1 + fi } -runTest() { - TEST_USERSTORY="$1" - TEST_POD_NAME="$2" +runTestWorkspaceWithGitRepoUrl() { + WS_NAME=$1 + PROJECT_NAME=$2 + GIT_REPO_URL=$3 + OCP_USER_NAMESPACE=$4 - patchTestPodConfig "${TEST_USERSTORY}" "${TEST_POD_NAME}" + oc project ${OCP_USER_NAMESPACE} + cat .ci/openshift-ci/devworkspace-test.yaml > devworkspace-test.yaml - # Create the test pod - oc apply -f plugins-test-pod.yaml + # patch the devworkspace-test.yaml file + sed -i "s#ws-name#${WS_NAME}#g" devworkspace-test.yaml + sed -i "s#project-name#${PROJECT_NAME}#g" devworkspace-test.yaml + sed -i "s#git-repo-url#${GIT_REPO_URL}#g" devworkspace-test.yaml - # wait for the pod to start - while true; do - sleep 3 - PHASE=$(oc get pod -n ${TEST_POD_NAMESPACE} "${TEST_POD_NAME}" \ - --template='{{ .status.phase }}') - if [[ ${PHASE} == "Running" ]]; then - break - fi - done + cat devworkspace-test.yaml - # wait for the test to finish - oc logs -n ${TEST_POD_NAMESPACE} "${TEST_POD_NAME}" -c ${TEST_CONTAINER_NAME} -f + oc apply -f devworkspace-test.yaml -n ${OCP_USER_NAMESPACE} + oc wait -n ${OCP_USER_NAMESPACE} --for=condition=Ready dw ${WS_NAME} --timeout=360s + echo "[INFO] Test workspace is run" +} - # just to sleep - sleep 3 +deleteTestWorkspace() { + WS_NAME=$1 + OCP_USER_NAMESPACE=$2 - downloadTestResults "${TEST_USERSTORY}" "${TEST_POD_NAME}" - cleanUpAfterTest "${TEST_POD_NAME}" || echo "Cleanup after test has failed" + oc delete dw ${WS_NAME} -n ${OCP_USER_NAMESPACE} } -createTestPodNamespace(){ - oc create namespace $TEST_POD_NAMESPACE +testClonePublicRepoNoPatOAuth() { + WS_NAME=$1 + PROJECT_NAME=$2 + GIT_REPO_URL=$3 + OCP_USER_NAMESPACE=$4 + + runTestWorkspaceWithGitRepoUrl ${WS_NAME} ${PROJECT_NAME} ${GIT_REPO_URL} ${OCP_USER_NAMESPACE} + echo "[INFO] Check the public repository is cloned" + testProjectIsCloned ${PROJECT_NAME} ${OCP_USER_NAMESPACE} || \ + { echo "[ERROR] Project file /projects/${PROJECT_NAME}/${YAML_FILE_NAME} should be present." && exit 1; } + deleteTestWorkspace ${WS_NAME} ${OCP_USER_NAMESPACE} } -setupTestEnvironment(){ +setupTestEnvironment() { + OCP_USER_NAME=$1 + provisionOpenShiftOAuthUser - createGithubSecret createCustomResourcesFile deployChe - createTestPodNamespace + forwardPortToService + initUserNamespace "${OCP_USER_NAME}" } diff --git a/.ci/openshift-ci/github-conf.yaml b/.ci/openshift-ci/github-conf.yaml deleted file mode 100644 index 2d9c7fe05a..0000000000 --- a/.ci/openshift-ci/github-conf.yaml +++ /dev/null @@ -1,14 +0,0 @@ -kind: Secret -apiVersion: v1 -metadata: - name: github-oauth-config - namespace: eclipse-che - labels: - app.kubernetes.io/part-of: che.eclipse.org - app.kubernetes.io/component: oauth-scm-configuration - annotations: - che.eclipse.org/oauth-scm-server: github -type: Opaque -data: - id: M2I4NTM4Y2FhNjEwOTBiYjY2NTU= - secret: ZGVkOTA5NmVhZDBkNDkyOTNlZDJhNTVmMzZkMzgwMmIxNzM4MDUyNg== diff --git a/.ci/openshift-ci/htpasswdProvider.yaml b/.ci/openshift-ci/htpasswdProvider.yaml deleted file mode 100644 index 6818e49b5b..0000000000 --- a/.ci/openshift-ci/htpasswdProvider.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: config.openshift.io/v1 -kind: OAuth -metadata: - name: cluster -spec: - identityProviders: - - name: htpasswd - mappingMethod: claim - type: HTPasswd - htpasswd: - fileData: - name: htpass-secret diff --git a/.ci/openshift-ci/nightly-test.sh b/.ci/openshift-ci/nightly-test.sh deleted file mode 100755 index 44bc826d72..0000000000 --- a/.ci/openshift-ci/nightly-test.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2021 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# - -################################ !!! IMPORTANT !!! ################################ -########### THIS JOB USE openshift ci operators workflows to run ##################### -########## More info about how it is configured can be found here: https://docs.ci.openshift.org/docs/how-tos/testing-operator-sdk-operators ############# -####################################################################################################################################################### - -# exit immediately when a command fails -set -e -# only exit with zero if all commands of the pipeline exit successfully -set -o pipefail - -# import common test functions -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -# shellcheck source=./.ci/openshift-ci/common-functions.sh -source "${SCRIPT_DIR}"/common-functions.sh - -# runTests() { -# runTest "InstallPluginUsingUI" "install-plugin-test" -# runTest "JavaPlugin" "java11-plugin-test" -# runTest "PhpPlugin" "php-plugin-test" -# runTest "PythonPlugin" "python-plugin-test" -# runTest "TypescriptPlugin" "typescript-debug-plugins" -# runTest "VscodeKubernetesPlugin" "nodejs-24lop" -# runTest "VscodeShellcheckPlugin" "nodejs-zmecm" -# runTest "VscodeValePlugin" "che-docs-test" -# runTest "VscodeXmlPlugin" "xml-plugin-test" -# runTest "VscodeYamlPlugin" "nodejs-zmecm" -# runTest "GitHubPullRequestPlugin" "github-pr-plugin" -# } - -setupTestEnvironment -# runTests -finishReport diff --git a/.ci/openshift-ci/plugins-test-pod.yaml b/.ci/openshift-ci/plugins-test-pod.yaml deleted file mode 100644 index 426437efee..0000000000 --- a/.ci/openshift-ci/plugins-test-pod.yaml +++ /dev/null @@ -1,77 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: POD_NAME - namespace: plugin-registry-test -spec: - volumes: - - name: test-run-results - - name: dshm - emptyDir: - medium: Memory - containers: - # container containing the tests - - name: plugins-test - image: quay.io/eclipse/che-e2e:next - imagePullPolicy: Always - env: - - name: TS_GITHUB_USERNAME - value: GH_USERNAME - - name: TS_GITHUB_PASSWORD - value: GH_PASSWORD - - name: E2E_OPENSHIFT_TOKEN - value: OCP_TOKEN - - name: TS_SELENIUM_OCP_USERNAME - value: 'user' - - name: TS_SELENIUM_OCP_PASSWORD - value: 'user' - - name: TS_SELENIUM_VALUE_OPENSHIFT_OAUTH - value: 'true' - - name: TS_SELENIUM_USERNAME - value: 'admin' - - name: TS_SELENIUM_PASSWORD - value: 'admin' - - name: TS_OCP_LOGIN_PAGE_PROVIDER_TITLE - value: 'htpasswd' - - name: TEST_SUITE - value: test-plugin-ci - - name: USERSTORY - value: TEST_USERSTORY - - name: NODE_TLS_REJECT_UNAUTHORIZED - value: '0' - - name: TS_SELENIUM_BASE_URL - value: CHE_URL - - name: TS_SELENIUM_LOG_LEVEL - value: DEBUG - - name: TS_SELENIUM_MULTIUSER - value: 'true' - - name: TS_SELENIUM_VALUE_TLS_SUPPORT - value: 'true' - - name: TS_SELENIUM_W3C_CHROME_OPTION - value: 'true' - volumeMounts: - - name: test-run-results - mountPath: /tmp/e2e/report/ - - name: dshm - mountPath: /dev/shm - resources: - requests: - memory: "4Gi" - cpu: "2000m" - limits: - memory: "8Gi" - cpu: "4000m" -# Download results - - name: download-reports - image: quay.io/ohrimenko1988/rsync:latest - imagePullPolicy: IfNotPresent - volumeMounts: - - name: test-run-results - mountPath: /tmp/e2e/report/ - command: ["sh"] - args: - [ - "-c", - "while true; if [[ -f /tmp/done ]]; then exit 0; fi; do sleep 1; done", - ] - restartPolicy: Never diff --git a/.ci/openshift-ci/smoke-test.sh b/.ci/openshift-ci/smoke-test.sh index 5f2c368ccb..37808ba57a 100755 --- a/.ci/openshift-ci/smoke-test.sh +++ b/.ci/openshift-ci/smoke-test.sh @@ -1,34 +1,31 @@ #!/bin/bash # -# Copyright (c) 2021 Red Hat, Inc. +# Copyright (c) 2023 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ # # SPDX-License-Identifier: EPL-2.0 # - -################################ !!! IMPORTANT !!! ################################ -########### THIS JOB USE openshift ci operators workflows to run ##################### -########## More info about how it is configured can be found here: https://docs.ci.openshift.org/docs/how-tos/testing-operator-sdk-operators ############# -####################################################################################################################################################### +# Contributors: +# Red Hat, Inc. - initial API and implementation +# # exit immediately when a command fails -set -e +set -ex # only exit with zero if all commands of the pipeline exit successfully set -o pipefail +export PUBLIC_REPO_URL=${PUBLIC_REPO_URL:-"https://github.com/chepullreq1/public-repo.git"} +export PRIVATE_REPO_URL=${PRIVATE_REPO_URL:-"https://github.com/chepullreq1/private-repo.git"} + # import common test functions SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -# shellcheck source=./.ci/openshift-ci/common-functions.sh source "${SCRIPT_DIR}"/common-functions.sh -runTests() { - runTest "VscodeYamlPlugin" "nodejs-zmecm" - runTest "TypescriptPlugin" "typescript-debug-plugins" -} +trap "catchFinish" EXIT SIGINT + +setupTestEnvironment ${OCP_NON_ADMIN_USER_NAME} -# should be reworked in case of https://github.com/eclipse/che/issues/21210 -# setupTestEnvironment -# runTests -# finishReport +testFactoryResolver ${PUBLIC_REPO_URL} +testClonePublicRepoNoPatOAuth ${PUBLIC_REPO_WORKSPACE_NAME} ${PUBLIC_PROJECT_NAME} ${PUBLIC_REPO_URL} ${USER_CHE_NAMESPACE} diff --git a/.github/workflows/happy-path.yaml b/.github/workflows/happy-path.yaml deleted file mode 100644 index b8ce3fe30f..0000000000 --- a/.github/workflows/happy-path.yaml +++ /dev/null @@ -1,82 +0,0 @@ -# -# Copyright (c) 2021 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# - -# che-plugin-registry Happy Path workflow -name: Happy Path - -on: - pull_request: - paths: - - '**/*' - - '!sidecars/**' - push: - paths: - - '**/*' - - '!sidecars/**' - -jobs: - happy-path: - runs-on: ubuntu-22.04 - steps: - - name: Clone source code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Clone source code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: '16' - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v3 - name: Cache yarn dependencies - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: image-build - run: | - export SKIP_FORMAT=true - export SKIP_LINT=true - export SKIP_TEST=true - docker pull quay.io/eclipse/che-plugin-registry:next - # save locally built image - docker save -o docker-image.tar quay.io/eclipse/che-plugin-registry:happy-path - - name: Start minikube - id: run-minikube - uses: che-incubator/setup-minikube-action@next - with: - minikube-version: v1.21.0 - - name: load-image-minikube-registry - id: load-image-minikube-registry - run: | - # load image in the docker registry - eval $(minikube docker-env) - docker load --input=docker-image.tar - # display images - docker images - - name: Deploy Eclipse Che - id: deploy-che - uses: che-incubator/che-deploy-action@next - with: - # use custom image built by this PR - plugin-registry-image: quay.io/eclipse/che-plugin-registry:happy-path - - name: Run Happy Path tests - id: run-happy-path-tests - uses: che-incubator/happy-path-tests-action@next - with: - che-url: ${{ steps.deploy-che.outputs.che-url }}