mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Skip tests if all changes in docs (#6870)
* Skip tests if all changes in website (and .ibm for testing this PR) * Use Merge base * Add rule for podman-test on GH Actions
This commit is contained in:
7
.github/workflows/podman-test.yaml
vendored
7
.github/workflows/podman-test.yaml
vendored
@@ -3,7 +3,12 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- 'docs/**'
|
||||||
|
- CONTRIBUTING.md
|
||||||
|
- OWNERS
|
||||||
|
- README.md
|
||||||
|
- USAGE_DATA.md
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ODO-PODMAN-TEST:
|
ODO-PODMAN-TEST:
|
||||||
|
|||||||
@@ -44,3 +44,29 @@ cleanup_namespaces() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skip_if_only() {
|
||||||
|
echo "Checking if tests need to be executed..."
|
||||||
|
NAMES=$(git diff --merge-base --name-only main)
|
||||||
|
for change in ${NAMES}; do
|
||||||
|
skip $change
|
||||||
|
if [[ $? == 0 ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo " => Skipping the tests."
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
skip() {
|
||||||
|
SKIP_IF_ONLY="docs/ CONTRIBUTING.md OWNERS README.md USAGE_DATA.md"
|
||||||
|
change=$1
|
||||||
|
for skip in ${SKIP_IF_ONLY}; do
|
||||||
|
if [[ "${change}" == "${skip}"* ]]; then
|
||||||
|
echo " - ${change} is ${skip}*"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo " - $change not in $SKIP_IF_ONLY"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ LOGFILE="pr-${GIT_PR_NUMBER}-kubernetes-tests-${BUILD_NUMBER}"
|
|||||||
|
|
||||||
source .ibm/pipelines/functions.sh
|
source .ibm/pipelines/functions.sh
|
||||||
|
|
||||||
|
skip_if_only
|
||||||
|
|
||||||
ibmcloud login --apikey "${API_KEY_QE}"
|
ibmcloud login --apikey "${API_KEY_QE}"
|
||||||
ibmcloud target -r "${IBM_REGION}"
|
ibmcloud target -r "${IBM_REGION}"
|
||||||
ibmcloud ks cluster config --cluster "${IBM_KUBERNETES_ID}" --admin
|
ibmcloud ks cluster config --cluster "${IBM_KUBERNETES_ID}" --admin
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ LOGFILE="pr-${GIT_PR_NUMBER}-nocluster-tests-${BUILD_NUMBER}"
|
|||||||
|
|
||||||
source .ibm/pipelines/functions.sh
|
source .ibm/pipelines/functions.sh
|
||||||
|
|
||||||
|
skip_if_only
|
||||||
|
|
||||||
ibmcloud login --apikey "${API_KEY_QE}"
|
ibmcloud login --apikey "${API_KEY_QE}"
|
||||||
ibmcloud target -r "${IBM_REGION}"
|
ibmcloud target -r "${IBM_REGION}"
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ LOGFILE="pr-${GIT_PR_NUMBER}-openshift-tests-${BUILD_NUMBER}"
|
|||||||
|
|
||||||
source .ibm/pipelines/functions.sh
|
source .ibm/pipelines/functions.sh
|
||||||
|
|
||||||
|
skip_if_only
|
||||||
|
|
||||||
ibmcloud login --apikey "${API_KEY_QE}"
|
ibmcloud login --apikey "${API_KEY_QE}"
|
||||||
ibmcloud target -r eu-de
|
ibmcloud target -r eu-de
|
||||||
ibmcloud oc cluster config -c "${CLUSTER_ID}"
|
ibmcloud oc cluster config -c "${CLUSTER_ID}"
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ LOGFILE="pr-${GIT_PR_NUMBER}-openshift-unauth-tests-${BUILD_NUMBER}"
|
|||||||
|
|
||||||
source .ibm/pipelines/functions.sh
|
source .ibm/pipelines/functions.sh
|
||||||
|
|
||||||
|
skip_if_only
|
||||||
|
|
||||||
ibmcloud login --apikey "${API_KEY_QE}"
|
ibmcloud login --apikey "${API_KEY_QE}"
|
||||||
ibmcloud target -r eu-de
|
ibmcloud target -r eu-de
|
||||||
ibmcloud oc cluster config -c "${CLUSTER_ID}"
|
ibmcloud oc cluster config -c "${CLUSTER_ID}"
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ LOGFILE="pr-${GIT_PR_NUMBER}-unit-tests-${BUILD_NUMBER}"
|
|||||||
|
|
||||||
source .ibm/pipelines/functions.sh
|
source .ibm/pipelines/functions.sh
|
||||||
|
|
||||||
|
skip_if_only
|
||||||
|
|
||||||
(
|
(
|
||||||
set -e
|
set -e
|
||||||
make test
|
make test
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ LOGFILE="pr-${GIT_PR_NUMBER}-Validate-tests-${BUILD_NUMBER}"
|
|||||||
|
|
||||||
source .ibm/pipelines/functions.sh
|
source .ibm/pipelines/functions.sh
|
||||||
|
|
||||||
|
skip_if_only
|
||||||
|
|
||||||
(
|
(
|
||||||
set -e
|
set -e
|
||||||
make goget-tools
|
make goget-tools
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
source .ibm/pipelines/functions.sh
|
||||||
|
|
||||||
|
skip_if_only
|
||||||
|
|
||||||
LOGFILE="pr-${GIT_PR_NUMBER}-windows-tests-${BUILD_NUMBER}"
|
LOGFILE="pr-${GIT_PR_NUMBER}-windows-tests-${BUILD_NUMBER}"
|
||||||
export REPO=${REPO:-"https://github.com/redhat-developer/odo"}
|
export REPO=${REPO:-"https://github.com/redhat-developer/odo"}
|
||||||
#copy test script inside /tmp/
|
#copy test script inside /tmp/
|
||||||
@@ -19,7 +23,6 @@ RESULT=$?
|
|||||||
echo "RESULT: $RESULT"
|
echo "RESULT: $RESULT"
|
||||||
|
|
||||||
# save log
|
# save log
|
||||||
source .ibm/pipelines/functions.sh
|
|
||||||
ibmcloud login --apikey "${API_KEY}" -r "${IBM_REGION}"
|
ibmcloud login --apikey "${API_KEY}" -r "${IBM_REGION}"
|
||||||
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no Administrator@$WINDOWS_IP:~/AppData/Local/Temp/${LOGFILE} /tmp/${LOGFILE}
|
sshpass -p $WINDOWS_PASSWORD scp -o StrictHostKeyChecking=no Administrator@$WINDOWS_IP:~/AppData/Local/Temp/${LOGFILE} /tmp/${LOGFILE}
|
||||||
save_logs "${LOGFILE}" "Windows Tests (OCP)" $RESULT
|
save_logs "${LOGFILE}" "Windows Tests (OCP)" $RESULT
|
||||||
|
|||||||
Reference in New Issue
Block a user