From 573e414adbeeffe562084ea427fc8703bf585591 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 14:18:11 +0000 Subject: [PATCH 01/16] Add nightly check and use specific version (currently the same) in PR checks --- .github/workflows/nightly.yml | 41 +++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 10 +++++---- 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000000..83b46d8000 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,41 @@ +name: Daily compatibility check against latest substrate + +on: + schedule: + # Run at 8am every day + - cron: "0 5 * * *" + + +env: + CARGO_TERM_COLOR: always + +jobs: + tests: + name: Cargo test + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Download Substrate + run: | + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate" --output substrate --location + chmod +x substrate + mkdir -p ~/.local/bin + mv substrate ~/.local/bin + + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Rust Cache + uses: Swatinem/rust-cache@v1.3.0 + + - name: Cargo test + uses: actions-rs/cargo@v1.0.3 + with: + command: test + args: --all-targets --workspace diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 865afb6468..e6bfde497a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,6 +14,8 @@ on: env: CARGO_TERM_COLOR: always + # TODO What is available to put here? Is it sufficient? + SUBSTRATE_VERSION: latest jobs: build: @@ -25,7 +27,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate" --output substrate --location + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$LATEST/substrate/substrate" --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin @@ -79,7 +81,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate" --output substrate --location + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$LATEST/substrate/substrate" --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin @@ -106,7 +108,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate" --output substrate --location + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$LATEST/substrate/substrate" --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin @@ -136,7 +138,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate" --output substrate --location + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$LATEST/substrate/substrate" --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin From 43074dba377b7dde5aab0c3177d9158a5155f535 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 16:07:36 +0000 Subject: [PATCH 02/16] wrong var name, whoops --- .github/workflows/rust.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e6bfde497a..b5510d17ca 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -27,7 +27,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$LATEST/substrate/substrate" --output substrate --location + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$SUBSTRATE_VERSION/substrate/substrate" --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin @@ -81,7 +81,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$LATEST/substrate/substrate" --output substrate --location + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$SUBSTRATE_VERSION/substrate/substrate" --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin @@ -108,7 +108,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$LATEST/substrate/substrate" --output substrate --location + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$SUBSTRATE_VERSION/substrate/substrate" --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin @@ -138,7 +138,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$LATEST/substrate/substrate" --output substrate --location + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$SUBSTRATE_VERSION/substrate/substrate" --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin From 58d3d5a46e3ee7b05c2567e85f776753b4399b25 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 16:19:21 +0000 Subject: [PATCH 03/16] Create GH issue if nightly run fails --- .github/issue_templates/nightly-run-failed.md | 5 +++++ .github/workflows/nightly.yml | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .github/issue_templates/nightly-run-failed.md diff --git a/.github/issue_templates/nightly-run-failed.md b/.github/issue_templates/nightly-run-failed.md new file mode 100644 index 0000000000..3bbb73425e --- /dev/null +++ b/.github/issue_templates/nightly-run-failed.md @@ -0,0 +1,5 @@ +--- +title: Subxt integration tests failed on latest Substrate build. +--- + +The nightly CI run which downloads the latest version of Substrate ran into test failures, which likely means that there are breaking changes that need fixing in Subxt. \ No newline at end of file diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 83b46d8000..d8ea801b88 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -39,3 +39,18 @@ jobs: with: command: test args: --all-targets --workspace + + # If the previous step fails, create a new Github issue + # to nofity us about it. + - if: ${{ failure() }} + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Use this issue template: + filename: .github/nightly-run-failed.md + # Don't create a new issue; skip updating existing: + update_existing: false + # Look for new *open* issues in this search (we want to + # create a new one if we only find closed versions): + search_existing: open From d186c444e0783b3bdedeba09e7947b089d12698b Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 16:32:55 +0000 Subject: [PATCH 04/16] need tokio feature for RpcClient; match dependency in root Cargo.toml. --- .github/workflows/rust.yml | 2 +- test-runtime/Cargo.toml | 2 +- test-runtime/build.rs | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b5510d17ca..40025f3cc6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -97,7 +97,7 @@ jobs: uses: Swatinem/rust-cache@v1.3.0 - name: Check internal documentation links - run: RUSTDOCFLAGS="--deny broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items + run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items tests: name: Cargo test diff --git a/test-runtime/Cargo.toml b/test-runtime/Cargo.toml index 14707745ae..0094dd13cd 100644 --- a/test-runtime/Cargo.toml +++ b/test-runtime/Cargo.toml @@ -10,5 +10,5 @@ codec = { package = "parity-scale-codec", version = "2", default-features = fals [build-dependencies] subxt = { path = ".." } -async-std = { version = "1.9.0", features = ["attributes"] } sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "master" } +async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } diff --git a/test-runtime/build.rs b/test-runtime/build.rs index 0251219bc6..bea96ea10c 100644 --- a/test-runtime/build.rs +++ b/test-runtime/build.rs @@ -53,9 +53,8 @@ async fn main() { // Download metadata from binary; retry until successful, or a limit is hit. let metadata_bytes: sp_core::Bytes = { - const MAX_RETRIES: usize = 20; + const MAX_RETRIES: usize = 1; let mut retries = 0; - let mut wait_secs = 1; loop { if retries >= MAX_RETRIES { panic!("Cannot connect to substrate node after {} retries", retries); @@ -72,9 +71,8 @@ async fn main() { break res } _ => { - thread::sleep(time::Duration::from_secs(wait_secs)); + thread::sleep(time::Duration::from_secs(1)); retries += 1; - wait_secs += 1; } }; } From 4c70860ec35d927c609e1cd5ec69c095b1670ada Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 17:23:40 +0000 Subject: [PATCH 05/16] Ensure substrate command is properly cleaned up in the event of a panic, to prevent blocking --- test-runtime/build.rs | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/test-runtime/build.rs b/test-runtime/build.rs index bea96ea10c..e8d2a06fba 100644 --- a/test-runtime/build.rs +++ b/test-runtime/build.rs @@ -25,13 +25,17 @@ use std::{ Ordering, }, thread, - time, + time, ops::{Deref, DerefMut}, }; static SUBSTRATE_BIN_ENV_VAR: &str = "SUBSTRATE_NODE_PATH"; #[async_std::main] async fn main() { + run().await; +} + +async fn run() { // Select substrate binary to run based on env var. let substrate_bin = env::var(SUBSTRATE_BIN_ENV_VAR).unwrap_or_else(|_| "substrate".to_owned()); @@ -45,7 +49,7 @@ async fn main() { .arg(format!("--rpc-port={}", port)) .spawn(); let mut cmd = match cmd { - Ok(cmd) => cmd, + Ok(cmd) => KillOnDrop(cmd), Err(e) => { panic!("Cannot spawn substrate command '{}': {}", substrate_bin, e) } @@ -140,3 +144,26 @@ fn next_open_port() -> Option { } } } + +/// If the substrate process isn't explicilty killed on drop, +/// it seems that panics that occur while the command is running +/// will leave it running and block the build step from ever finishing. +/// Wrapping it in this prevents this from happening. +struct KillOnDrop(std::process::Child); + +impl Deref for KillOnDrop { + type Target = std::process::Child; + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl DerefMut for KillOnDrop { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl Drop for KillOnDrop { + fn drop(&mut self) { + let _ = self.0.kill(); + } +} \ No newline at end of file From 646275ba1fba533f9ecca44e2c341b4ea31672db Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 17:26:55 +0000 Subject: [PATCH 06/16] increase retry limit again --- test-runtime/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-runtime/build.rs b/test-runtime/build.rs index e8d2a06fba..0111248a48 100644 --- a/test-runtime/build.rs +++ b/test-runtime/build.rs @@ -57,7 +57,7 @@ async fn run() { // Download metadata from binary; retry until successful, or a limit is hit. let metadata_bytes: sp_core::Bytes = { - const MAX_RETRIES: usize = 1; + const MAX_RETRIES: usize = 20; let mut retries = 0; loop { if retries >= MAX_RETRIES { From a4508e6fe5bd3ce2ddf6713237572892e521ba72 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 17:36:49 +0000 Subject: [PATCH 07/16] fmt --- test-runtime/build.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test-runtime/build.rs b/test-runtime/build.rs index 0111248a48..bc35b7cc76 100644 --- a/test-runtime/build.rs +++ b/test-runtime/build.rs @@ -18,6 +18,10 @@ use std::{ env, fs, net::TcpListener, + ops::{ + Deref, + DerefMut, + }, path::Path, process::Command, sync::atomic::{ @@ -25,7 +29,7 @@ use std::{ Ordering, }, thread, - time, ops::{Deref, DerefMut}, + time, }; static SUBSTRATE_BIN_ENV_VAR: &str = "SUBSTRATE_NODE_PATH"; @@ -166,4 +170,4 @@ impl Drop for KillOnDrop { fn drop(&mut self) { let _ = self.0.kill(); } -} \ No newline at end of file +} From 40d0cb706bde3c5c03651d217116a4a619969682 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 17:49:09 +0000 Subject: [PATCH 08/16] Tweak text for nightly-run-failed issue template --- .github/issue_templates/nightly-run-failed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/issue_templates/nightly-run-failed.md b/.github/issue_templates/nightly-run-failed.md index 3bbb73425e..96566ddd86 100644 --- a/.github/issue_templates/nightly-run-failed.md +++ b/.github/issue_templates/nightly-run-failed.md @@ -1,5 +1,5 @@ --- -title: Subxt integration tests failed on latest Substrate build. +title: Subxt integration tests failed against latest Substrate build. --- The nightly CI run which downloads the latest version of Substrate ran into test failures, which likely means that there are breaking changes that need fixing in Subxt. \ No newline at end of file From 64578bcd0d911e50165dca0e98f794df24e8ed8f Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 17:49:26 +0000 Subject: [PATCH 09/16] Run nightly-CI every 5mins for testing --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d8ea801b88..2563015e6a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,7 +3,7 @@ name: Daily compatibility check against latest substrate on: schedule: # Run at 8am every day - - cron: "0 5 * * *" + - cron: "0 5 */5 * *" # TESTING: REMOVE /5 PRIOR TO MERGE env: From 940900e4dc1bfc937fb3b050667e08500a7a5a16 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 17:52:10 +0000 Subject: [PATCH 10/16] I clearly dont use cron enough --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2563015e6a..e6f09dc14f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,7 +3,7 @@ name: Daily compatibility check against latest substrate on: schedule: # Run at 8am every day - - cron: "0 5 */5 * *" # TESTING: REMOVE /5 PRIOR TO MERGE + - cron: "*/5 * * * *" # TESTING env: From 4667e05d6f00b4035d60320419f846c976c99659 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 18:21:19 +0000 Subject: [PATCH 11/16] Put back cron timings to 8am daily --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e6f09dc14f..d27a19b1dd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,7 +3,7 @@ name: Daily compatibility check against latest substrate on: schedule: # Run at 8am every day - - cron: "*/5 * * * *" # TESTING + - cron: "* 8 * * *" env: From 6ed9c11afe3c5906b71986f7bc219ca1493a1843 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 18:24:01 +0000 Subject: [PATCH 12/16] break a test --- .github/workflows/nightly.yml | 2 +- tests/integration/frame/balances.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d27a19b1dd..e6f09dc14f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,7 +3,7 @@ name: Daily compatibility check against latest substrate on: schedule: # Run at 8am every day - - cron: "* 8 * * *" + - cron: "*/5 * * * *" # TESTING env: diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index 8b12790ffa..54cbaf26ca 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -80,7 +80,7 @@ async fn tx_basic_transfer() { let expected_event = balances::events::Transfer { from: alice.account_id().clone(), to: bob.account_id().clone(), - amount: 10_000, + amount: 10_000_000_0, // TESTING }; assert_eq!(event, expected_event); From 36c4c2f24ea14cd131fba8af868381e241c0b6bf Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 18:32:41 +0000 Subject: [PATCH 13/16] revert nightly workflow again (doesnt run off master) and testing rust workflow --- .github/workflows/nightly.yml | 2 +- .github/workflows/rust.yml | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e6f09dc14f..d27a19b1dd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,7 +3,7 @@ name: Daily compatibility check against latest substrate on: schedule: # Run at 8am every day - - cron: "*/5 * * * *" # TESTING + - cron: "* 8 * * *" env: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 40025f3cc6..dc39eb100a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -97,7 +97,7 @@ jobs: uses: Swatinem/rust-cache@v1.3.0 - name: Check internal documentation links - run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --verbose --workspace --no-deps --document-private-items + run: RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc -vv --workspace --no-deps --document-private-items tests: name: Cargo test @@ -129,6 +129,21 @@ jobs: command: test args: --all-targets --workspace + # If the previous step fails, create a new Github issue + # to nofity us about it. + - if: ${{ failure() }} + uses: JasonEtco/create-an-issue@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # Use this issue template: + filename: .github/nightly-run-failed.md + # Don't create a new issue; skip updating existing: + update_existing: false + # Look for new *open* issues in this search (we want to + # create a new one if we only find closed versions): + search_existing: open + clippy: name: Cargo clippy runs-on: ubuntu-latest From 26559fbff065efd7d6f6a329f0c0a735d5fbdca6 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 18:41:12 +0000 Subject: [PATCH 14/16] more testing.. --- .../{nightly-run-failed.md => nightly_run_failed.md} | 0 .github/workflows/nightly.yml | 2 +- .github/workflows/rust.yml | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename .github/issue_templates/{nightly-run-failed.md => nightly_run_failed.md} (100%) diff --git a/.github/issue_templates/nightly-run-failed.md b/.github/issue_templates/nightly_run_failed.md similarity index 100% rename from .github/issue_templates/nightly-run-failed.md rename to .github/issue_templates/nightly_run_failed.md diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d27a19b1dd..38759e6018 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -48,7 +48,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: # Use this issue template: - filename: .github/nightly-run-failed.md + filename: .github/issue_templates/nightly_run_failed.md # Don't create a new issue; skip updating existing: update_existing: false # Look for new *open* issues in this search (we want to diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index dc39eb100a..f24ee81fee 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -137,7 +137,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: # Use this issue template: - filename: .github/nightly-run-failed.md + filename: .github/issue_templates/nightly_run_failed.md # Don't create a new issue; skip updating existing: update_existing: false # Look for new *open* issues in this search (we want to From a9430a9bf25d812648eff0aaf66653e42d2ed7cc Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 29 Nov 2021 18:49:27 +0000 Subject: [PATCH 15/16] undo testing things; seems to work --- .github/workflows/rust.yml | 15 --------------- tests/integration/frame/balances.rs | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f24ee81fee..6698e31d37 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -129,21 +129,6 @@ jobs: command: test args: --all-targets --workspace - # If the previous step fails, create a new Github issue - # to nofity us about it. - - if: ${{ failure() }} - uses: JasonEtco/create-an-issue@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - # Use this issue template: - filename: .github/issue_templates/nightly_run_failed.md - # Don't create a new issue; skip updating existing: - update_existing: false - # Look for new *open* issues in this search (we want to - # create a new one if we only find closed versions): - search_existing: open - clippy: name: Cargo clippy runs-on: ubuntu-latest diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index 54cbaf26ca..8b12790ffa 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -80,7 +80,7 @@ async fn tx_basic_transfer() { let expected_event = balances::events::Transfer { from: alice.account_id().clone(), to: bob.account_id().clone(), - amount: 10_000_000_0, // TESTING + amount: 10_000, }; assert_eq!(event, expected_event); From daf86d84476ca96cecfa88b85f0637c05686fd8b Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 30 Nov 2021 13:33:18 +0000 Subject: [PATCH 16/16] tidy up; substrate url at top of both CI files --- .github/workflows/nightly.yml | 4 +++- .github/workflows/rust.yml | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 38759e6018..b47dcf6acc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,6 +8,8 @@ on: env: CARGO_TERM_COLOR: always + # Use latest substrate for nightly runs: + SUBSTRATE_URL: https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate jobs: tests: @@ -19,7 +21,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate" --output substrate --location + curl $SUBSTRATE_URL --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6698e31d37..73078643f0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,8 +14,8 @@ on: env: CARGO_TERM_COLOR: always - # TODO What is available to put here? Is it sufficient? - SUBSTRATE_VERSION: latest + # TODO: Currently pointing at latest substrate; is there a suitable binary we can pin to here? + SUBSTRATE_URL: https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate jobs: build: @@ -27,7 +27,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$SUBSTRATE_VERSION/substrate/substrate" --output substrate --location + curl $SUBSTRATE_URL --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin @@ -81,7 +81,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$SUBSTRATE_VERSION/substrate/substrate" --output substrate --location + curl $SUBSTRATE_URL --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin @@ -108,7 +108,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$SUBSTRATE_VERSION/substrate/substrate" --output substrate --location + curl $SUBSTRATE_URL --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin @@ -138,7 +138,7 @@ jobs: - name: Download Substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/$SUBSTRATE_VERSION/substrate/substrate" --output substrate --location + curl $SUBSTRATE_URL --output substrate --location chmod +x substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin