Fix check_polkadot CI check (#4317)

* Fix `check_polkadot` CI check

* Another try

* Use path overrides

* Last fix

* Update .gitlab-ci.yml

* Fix wasm builder

* Update wasm_project.rs
This commit is contained in:
Bastian Köcher
2019-12-07 23:36:47 +01:00
committed by GitHub
parent b8ac094649
commit 94b6921d03
2 changed files with 6 additions and 10 deletions
+5 -10
View File
@@ -357,20 +357,15 @@ check_polkadot:
<<: *docker-env <<: *docker-env
allow_failure: true allow_failure: true
script: script:
- COMMIT_HASH=$(git rev-parse HEAD)
- SUBSTRATE_PATH=$(pwd) - SUBSTRATE_PATH=$(pwd)
# Clone the current Polkadot master branch into ./polkadot. # Clone the current Polkadot master branch into ./polkadot.
- git clone --depth 1 https://gitlab.parity.io/parity/polkadot.git - git clone --depth 1 https://gitlab.parity.io/parity/polkadot.git
- cd polkadot - cd polkadot
# Within Polkadot 'master' alter each Cargo.toml that references the # Make sure we override the crates in native and wasm build
# Substrate 'polkadot-master' branch: - mkdir .cargo
# 1. Replace the 'branch = "polkadot-master"' statements with the rev of our - echo "paths = [ \"$SUBSTRATE_PATH\" ]" > .cargo/config
# commit. - mkdir -p target/debug/wbuild/.cargo
# 2. Replace 'git = "https://.*"' with 'git = "file://.*"' (the local - echo "paths = [ \"$SUBSTRATE_PATH\" ]" > target/debug/wbuild/.cargo/config
# checked out Substrate repository one folder above).
# 3. Remove any trailing commas.
- git grep -l "polkadot-master" | grep toml | xargs sed -i "s/branch.*=.*\"polkadot-master\"/rev = \"$COMMIT_HASH\"/; s~https://github.com/paritytech/substrate~file://$SUBSTRATE_PATH~; s/,\s*}/ }/"
# Make sure 'Cargo.lock' matches 'Cargo.toml'. It's enough to update one
# package, others are updated along the way. # package, others are updated along the way.
- cargo update -p sp-io - cargo update -p sp-io
# Check whether Polkadot 'master' branch builds with this Substrate commit. # Check whether Polkadot 'master' branch builds with this Substrate commit.
@@ -181,6 +181,7 @@ fn create_wasm_workspace_project(wasm_workspace: &Path, cargo_manifest: &Path) {
.map(|d| d.into_path()) .map(|d| d.into_path())
.filter(|p| p.is_dir() && !p.ends_with("target")) .filter(|p| p.is_dir() && !p.ends_with("target"))
.filter_map(|p| p.file_name().map(|f| f.to_owned()).and_then(|s| s.into_string().ok())) .filter_map(|p| p.file_name().map(|f| f.to_owned()).and_then(|s| s.into_string().ok()))
.filter(|f| !f.starts_with("."))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let crate_metadata = MetadataCommand::new() let crate_metadata = MetadataCommand::new()