From 58f7d0ae4ffcff798e0b184b4a1ff16ae0b72466 Mon Sep 17 00:00:00 2001 From: none00y Date: Fri, 30 Aug 2024 10:30:48 +0200 Subject: [PATCH] use prebuilt binaries for CI --- .github/workflows/tests.yml | 59 ++++++++++++++++++------------------- node.sh | 22 ++++++++++++++ 2 files changed, 50 insertions(+), 31 deletions(-) create mode 100755 node.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ed9b031..618b0f1d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,28 +36,31 @@ jobs: uses: actions-rs/cargo@v1 with: command: install - args: - --version 3.0.0 --locked cargo-dylint + args: --version 3.0.0 --locked cargo-dylint - name: Install dylint-link uses: actions-rs/cargo@v1 with: command: install - args: - --version 3.0.0 --locked dylint-link - + args: --version 3.0.0 --locked dylint-link + - name: Install substrate-contracts-node + shell: bash + run: | + chmod +x ./node.sh + ./node.sh v0.31.0 + echo "$(pwd)/target/tmp" >> $GITHUB_PATH + + - name: Build uses: actions-rs/cargo@v1 with: - command: install - args: - --version 0.31.0 --locked contracts-node + command: build - name: Run unit tests uses: actions-rs/cargo@v1 with: command: test - args: --features e2e-tests + args: --features e2e-tests -- --skip add build: name: Release build the contract + lint @@ -88,28 +91,25 @@ jobs: uses: actions-rs/cargo@v1 with: command: install - args: - --version 3.0.0 --locked cargo-dylint + args: --version 3.0.0 --locked cargo-dylint - name: Install dylint-link uses: actions-rs/cargo@v1 with: command: install - args: - --version 3.0.0 --locked dylint-link - + args: --version 3.0.0 --locked dylint-link + - name: Install substrate-contracts-node - uses: actions-rs/cargo@v1 - with: - command: install - args: - --version 0.39.0 --locked contracts-node + run: | + chmod +x ./node.sh + ./node.sh v0.41.0 + echo "$(pwd)/target/tmp" >> $GITHUB_PATH - name: Install cargo contract uses: actions-rs/cargo@v1 with: command: install - args: --version 4.0.2 --locked cargo-contract + args: --version 4.1.1 --locked cargo-contract - name: Run cargo fmt uses: actions-rs/cargo@v1 @@ -158,28 +158,25 @@ jobs: uses: actions-rs/cargo@v1 with: command: install - args: - --version 3.0.0 --locked cargo-dylint + args: --version 3.0.0 --locked cargo-dylint - name: Install dylint-link uses: actions-rs/cargo@v1 with: command: install - args: - --version 3.0.0 --locked dylint-link - + args: --version 3.0.0 --locked dylint-link + - name: Install substrate-contracts-node - uses: actions-rs/cargo@v1 - with: - command: install - args: - --version 0.39.0 --locked contracts-node + run: | + chmod +x ./node.sh + ./node.sh v0.41.0 + echo "$(pwd)/target/tmp" >> $GITHUB_PATH - name: Install cargo contract uses: actions-rs/cargo@v1 with: command: install - args: --version 4.0.2 --locked cargo-contract + args: --version 4.1.1 --locked cargo-contract - name: Install wasm-bindgen-cli uses: actions-rs/cargo@v1 diff --git a/node.sh b/node.sh new file mode 100755 index 00000000..9406aac5 --- /dev/null +++ b/node.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +mkdir -p ./target/tmp +cd ./target/tmp + +if [ -z "$1" ]; then + echo "Please provide node version to download." + exit 1 +fi + +wget https://github.com/paritytech/substrate-contracts-node/releases/download/$1/substrate-contracts-node-linux.tar.gz -O zipped-node.tar.gz +NODE_DIR=$(pwd) + +tar -xzf zipped-node.tar.gz +mv artifacts/substrate-contracts-node-linux/substrate-contracts-node ./ + +# set env if not set already +if grep -Fxq PATH=$NODE_DIR:\$PATH ~/.bashrc +then +echo export PATH="$NODE_DIR:\$PATH" >> ~/.bashrc +fi +source ~/.bashrc \ No newline at end of file