From ac1f78b0497a4fa166b5183cd9d8156233afa0e5 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:08:31 +0200 Subject: [PATCH 01/17] Try start a Polkadot service in the background of CI --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cd2586b79..f5bf9f972b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,10 +35,14 @@ jobs: wasm-node-check: name: Check javascript node runs-on: ubuntu-latest - container: - image: rust steps: + - run: docker run -it polkadot --chain polkadot-dev - uses: actions/checkout@v2.3.4 + - uses: actions-rs/toolchain@v1 + with: + # Ideally we don't want to install any toolchain, but the GH action doesn't support this. + toolchain: stable + profile: minimal - uses: Swatinem/rust-cache@v1 - uses: actions/setup-node@v2.4.0 with: From df414295709af592cf183fa116503ca195b92563 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:10:46 +0200 Subject: [PATCH 02/17] Not interactive --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5bf9f972b..9f2db6dcb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: name: Check javascript node runs-on: ubuntu-latest steps: - - run: docker run -it polkadot --chain polkadot-dev + - run: docker run polkadot --chain polkadot-dev - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 with: From 2ba943c993a5338c636a466b3c43679321d9b16a Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:11:50 +0200 Subject: [PATCH 03/17] Proper image --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f2db6dcb7..82cb7fa41d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: name: Check javascript node runs-on: ubuntu-latest steps: - - run: docker run polkadot --chain polkadot-dev + - run: docker run parity/polkadot --chain polkadot-dev - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 with: From 94faeacaadf6f30bd65f3e0db845981ab466f1f3 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:12:06 +0200 Subject: [PATCH 04/17] Test curl --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82cb7fa41d..28fd49ed58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,7 @@ jobs: runs-on: ubuntu-latest steps: - run: docker run parity/polkadot --chain polkadot-dev + - run: curl http://localhost:9933/ - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 with: From 35ce82ae880f08fc7eeb14d5b848a97cf10df314 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:30:10 +0200 Subject: [PATCH 05/17] Boop From 1a3718031eb5b95004b0ec34884104df4f7e1a7e Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:31:03 +0200 Subject: [PATCH 06/17] Err, need to detach the docker container --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28fd49ed58..9e2045d83b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: name: Check javascript node runs-on: ubuntu-latest steps: - - run: docker run parity/polkadot --chain polkadot-dev + - run: docker run -d parity/polkadot --chain polkadot-dev - run: curl http://localhost:9933/ - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 From 44b78a53d3a0492135527f36279a00fe17cc0d1e Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:31:18 +0200 Subject: [PATCH 07/17] Sleep for a bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e2045d83b..e8d188756a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: name: Check javascript node runs-on: ubuntu-latest steps: - - run: docker run -d parity/polkadot --chain polkadot-dev + - run: docker run -d parity/polkadot --chain polkadot-dev && sleep 5 - run: curl http://localhost:9933/ - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 From fd2dac835848287b9d11f8e61720fc69a4da6df4 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:36:31 +0200 Subject: [PATCH 08/17] Ok bump the sleep time --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8d188756a..5de593a779 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: name: Check javascript node runs-on: ubuntu-latest steps: - - run: docker run -d parity/polkadot --chain polkadot-dev && sleep 5 + - run: docker run -d parity/polkadot --chain polkadot-dev && sleep 15 - run: curl http://localhost:9933/ - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 From 09b566ca7127afd110a4001e59239b8e93f40f04 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:39:46 +0200 Subject: [PATCH 09/17] External RPC --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5de593a779..abb01ee505 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: name: Check javascript node runs-on: ubuntu-latest steps: - - run: docker run -d parity/polkadot --chain polkadot-dev && sleep 15 + - run: docker run -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external && sleep 15 - run: curl http://localhost:9933/ - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 From 424a5901e3f511b9ca0505af49f99de1a8a102a9 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:46:15 +0200 Subject: [PATCH 10/17] --network host --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abb01ee505..547df86a94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,8 @@ jobs: name: Check javascript node runs-on: ubuntu-latest steps: - - run: docker run -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external && sleep 15 + # Note: feel free to update the Polkadot version here when one is released + - run: docker run --network host -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external && sleep 15 - run: curl http://localhost:9933/ - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 From 28cd7805997cbffd5c914f11ebf42242c95dbd55 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:49:44 +0200 Subject: [PATCH 11/17] Needs sudo now --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 547df86a94..9958d4e8ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: - uses: actions/setup-node@v2.4.0 with: node-version: '12' - - run: apt-get update && apt install -y binaryen # For `wasm-opt` + - run: sudo apt-get update && apt install -y binaryen # For `wasm-opt` - run: cd bin/wasm-node/javascript && npm install-ci-test check-features: From 8df9cb5c9fe2b4c54e5cf3582f4276aa2970b720 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:52:30 +0200 Subject: [PATCH 12/17] Expand sudo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9958d4e8ef..718b8c4135 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: - uses: actions/setup-node@v2.4.0 with: node-version: '12' - - run: sudo apt-get update && apt install -y binaryen # For `wasm-opt` + - run: sudo apt-get update && sudo apt install -y binaryen # For `wasm-opt` - run: cd bin/wasm-node/javascript && npm install-ci-test check-features: From 2f982dbf0a1f7e0d1b9b8f1772dd87224d12bd8d Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 15:56:29 +0200 Subject: [PATCH 13/17] Remove the sleep --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 718b8c4135..07d518da92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,8 +37,9 @@ jobs: runs-on: ubuntu-latest steps: # Note: feel free to update the Polkadot version here when one is released - - run: docker run --network host -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external && sleep 15 - - run: curl http://localhost:9933/ + - run: docker run --network host -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external + - name: Wait for node to be up + run: while true; do curl localhost:9933; if [ $? -eq 0 ]; then break; fi; sleep 1; done - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 with: From d253057c7f6c63f282242dba7d2e21602cf3d7d0 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 16:08:47 +0200 Subject: [PATCH 14/17] Tweak check --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07d518da92..f52f7f89bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: # Note: feel free to update the Polkadot version here when one is released - run: docker run --network host -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external - name: Wait for node to be up - run: while true; do curl localhost:9933; if [ $? -eq 0 ]; then break; fi; sleep 1; done + run: bash -c 'while true; do curl -X POST -H "Content-Type: application/json" localhost:9933; if [ $? -eq 0 ]; then break; fi; sleep 1; done' - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 with: From 4212ae634df9e16648c7676c3e00d4110ab7d5cb Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 16:10:33 +0200 Subject: [PATCH 15/17] Now the freaking yaml is invalid, it's ridiculous --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f52f7f89bb..319092cf00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,8 @@ jobs: # Note: feel free to update the Polkadot version here when one is released - run: docker run --network host -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external - name: Wait for node to be up - run: bash -c 'while true; do curl -X POST -H "Content-Type: application/json" localhost:9933; if [ $? -eq 0 ]; then break; fi; sleep 1; done' + run: | + bash -c 'while true; do curl -X POST -H "Content-Type: application/json" localhost:9933; if [ $? -eq 0 ]; then break; fi; sleep 1; done' - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 with: From 76497eb8b11e4158860b1b0ae1659ded13a508b7 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 16:12:28 +0200 Subject: [PATCH 16/17] Add step name --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 319092cf00..567c18e62b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,8 +36,9 @@ jobs: name: Check javascript node runs-on: ubuntu-latest steps: - # Note: feel free to update the Polkadot version here when one is released - - run: docker run --network host -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external + - name: Start Polkadot node in the background + # Note: feel free to update the Polkadot version here when one is released + run: docker run --network host -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external - name: Wait for node to be up run: | bash -c 'while true; do curl -X POST -H "Content-Type: application/json" localhost:9933; if [ $? -eq 0 ]; then break; fi; sleep 1; done' From 304e0358c72efd4f6e0a0319d6a1761a307bde60 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 11 Aug 2021 16:18:29 +0200 Subject: [PATCH 17/17] Do a proper health request --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 567c18e62b..75a09e3258 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: run: docker run --network host -d parity/polkadot:v0.9.8 --chain polkadot-dev --unsafe-rpc-external --unsafe-ws-external - name: Wait for node to be up run: | - bash -c 'while true; do curl -X POST -H "Content-Type: application/json" localhost:9933; if [ $? -eq 0 ]; then break; fi; sleep 1; done' + bash -c 'while true; do curl -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"method\":\"system_health\",\"params\":[]}" localhost:9933; if [ $? -eq 0 ]; then break; fi; sleep 1; done' - uses: actions/checkout@v2.3.4 - uses: actions-rs/toolchain@v1 with: