From d5c5a3a671fd504307026bc59e1e7b27e9d2fa9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 14 Sep 2020 17:04:25 +0200 Subject: [PATCH 1/4] Use diener for Polkadot companion prs --- .../gitlab/check_polkadot_companion_build.sh | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.maintain/gitlab/check_polkadot_companion_build.sh b/.maintain/gitlab/check_polkadot_companion_build.sh index b78c26dea8458..f46aa2a1a705c 100755 --- a/.maintain/gitlab/check_polkadot_companion_build.sh +++ b/.maintain/gitlab/check_polkadot_companion_build.sh @@ -1,9 +1,9 @@ -#!/bin/sh +#!/usr/bin/env sh # -# check if a pr is compatible with polkadot companion pr or master if not +# check if a pr is compatible with polkadot companion pr or master if not # available # -# to override one that was just mentioned mark companion pr in the body of the +# to override one that was just mentioned mark companion pr in the body of the # polkadot pr like # # polkadot companion: paritytech/polkadot#567 @@ -12,7 +12,7 @@ github_api_substrate_pull_url="https://api.github.com/repos/paritytech/substrate/pulls" # use github api v3 in order to access the data without authentication -github_header="Authorization: token ${GITHUB_PR_TOKEN}" +github_header="Authorization: token ${GITHUB_PR_TOKEN}" boldprint () { printf "|\n| \033[1m${@}\033[0m\n|\n" ; } boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; done; printf "|\n" ; } @@ -40,6 +40,8 @@ EOT git config --global user.name 'CI system' git config --global user.email '<>' +cargo install -f --version 0.2.0 diener + SUBSTRATE_PATH=$(pwd) # Merge master into our branch before building Polkadot to make sure we don't miss @@ -85,14 +87,9 @@ else boldprint "this is not a pull request - building polkadot:master" fi -# Make sure we override the crates in native and wasm build -# patching the git path as described in the link below did not test correctly -# https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html -mkdir .cargo -echo "paths = [ \"$SUBSTRATE_PATH\" ]" > .cargo/config - -mkdir -p target/debug/wbuild/.cargo -cp .cargo/config target/debug/wbuild/.cargo/config +cd .. +~/.cargo/bin/diener --substrate --branch $(git branch --show-current) --git https://gitlab.parity.io/parity/substrate.git --path polkadot +cd polkadot # Test Polkadot pr or master branch with this Substrate commit. time cargo test --all --release --verbose From bee982899780141b82e89b04962b160367d58ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 14 Sep 2020 17:41:01 +0200 Subject: [PATCH 2/4] Fix script --- .maintain/gitlab/check_polkadot_companion_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.maintain/gitlab/check_polkadot_companion_build.sh b/.maintain/gitlab/check_polkadot_companion_build.sh index f46aa2a1a705c..49ed48cdd1b9f 100755 --- a/.maintain/gitlab/check_polkadot_companion_build.sh +++ b/.maintain/gitlab/check_polkadot_companion_build.sh @@ -88,7 +88,7 @@ else fi cd .. -~/.cargo/bin/diener --substrate --branch $(git branch --show-current) --git https://gitlab.parity.io/parity/substrate.git --path polkadot +$CARGO_HOME/bin/diener --substrate --branch $(git rev-parse --abbrev-ref HEAD) --git https://gitlab.parity.io/parity/substrate.git --path polkadot cd polkadot # Test Polkadot pr or master branch with this Substrate commit. From 535ab52597a25e8bf5218ef67a79f1531bd5929b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 14 Sep 2020 18:01:40 +0200 Subject: [PATCH 3/4] Use gitlab env variable --- .maintain/gitlab/check_polkadot_companion_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.maintain/gitlab/check_polkadot_companion_build.sh b/.maintain/gitlab/check_polkadot_companion_build.sh index 49ed48cdd1b9f..f693418ff4c38 100755 --- a/.maintain/gitlab/check_polkadot_companion_build.sh +++ b/.maintain/gitlab/check_polkadot_companion_build.sh @@ -88,7 +88,7 @@ else fi cd .. -$CARGO_HOME/bin/diener --substrate --branch $(git rev-parse --abbrev-ref HEAD) --git https://gitlab.parity.io/parity/substrate.git --path polkadot +$CARGO_HOME/bin/diener --substrate --branch $CI_COMMIT_REF_NAME --git https://gitlab.parity.io/parity/substrate.git --path polkadot cd polkadot # Test Polkadot pr or master branch with this Substrate commit. From 4b1a9c79aeb0053bf3298c698b56839bb26e4751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 14 Sep 2020 18:04:04 +0200 Subject: [PATCH 4/4] Update .maintain/gitlab/check_polkadot_companion_build.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> --- .maintain/gitlab/check_polkadot_companion_build.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.maintain/gitlab/check_polkadot_companion_build.sh b/.maintain/gitlab/check_polkadot_companion_build.sh index f693418ff4c38..2ee1e824aed5d 100755 --- a/.maintain/gitlab/check_polkadot_companion_build.sh +++ b/.maintain/gitlab/check_polkadot_companion_build.sh @@ -42,8 +42,6 @@ git config --global user.email '<>' cargo install -f --version 0.2.0 diener -SUBSTRATE_PATH=$(pwd) - # Merge master into our branch before building Polkadot to make sure we don't miss # any commits that are required by Polkadot. git merge origin/master