gitlab-ci: merge-test stage (#1752)

This commit is contained in:
gabriel klawitter
2019-02-15 14:54:21 +01:00
committed by Gav Wood
parent fafffdb771
commit 3cbf2bc9c4
3 changed files with 143 additions and 18 deletions
+16 -16
View File
@@ -8,6 +8,7 @@
set -e # fail on any error
# give some context
git log --graph --oneline --decorate=short -n 10
@@ -15,6 +16,18 @@ git log --graph --oneline --decorate=short -n 10
RUNTIME="node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm"
VERSIONS_FILE="node/runtime/src/lib.rs"
github_label () {
echo
echo "# run github-api job for labelling it ${1}"
curl -sS -X POST \
-F "token=${CI_JOB_TOKEN}" \
-F "ref=master" \
-F "variables[LABEL]=${1}" \
-F "variables[PRNO]=${CI_COMMIT_REF_NAME}" \
${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline
}
# check if the wasm sources changed
@@ -45,14 +58,8 @@ sub_spec_version="$(git diff origin/master...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
# see if the version and the binary blob changed
if [ "${add_spec_version}" != "${sub_spec_version}" ]
then
echo
echo "# run github-api job for labelling it breaksapi"
curl -sS -X POST \
-F "token=${CI_JOB_TOKEN}" \
-F "ref=master" \
-F "variables[BREAKSAPI]=true" \
-F "variables[PRNO]=${CI_COMMIT_REF_NAME}" \
${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline
github_label "B2-breaksapi"
if git diff --name-only origin/master...${CI_COMMIT_SHA} \
| grep -q "${RUNTIME}"
@@ -122,14 +129,7 @@ fi
# dropped through. there's something wrong; mark `gotissues` and exit 1.
echo
echo "# run github-api job for labelling it gotissues"
curl -sS -X POST \
-F "token=${CI_JOB_TOKEN}" \
-F "ref=master" \
-F "variables[GOTISSUES]=true" \
-F "variables[PRNO]=${CI_COMMIT_REF_NAME}" \
${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline
github_label "A4-gotissues"
exit 1