From 4ea0f97c75885b39819d28ec1bcf6fdf825db5c2 Mon Sep 17 00:00:00 2001 From: zjb0807 Date: Tue, 7 Nov 2023 19:28:50 +0800 Subject: [PATCH 1/2] Remove rustup --- .devcontainer/Dockerfile | 5 ----- .github/workflows/benchmark.yml | 8 +------- .github/workflows/publish-release.yml | 2 +- .github/workflows/test.yml | 4 ---- .github/workflows/test.yml.src | 4 ---- scripts/Dockerfile | 3 --- scripts/init.sh | 4 +--- scripts/profiling/Dockerfile | 3 --- 8 files changed, 3 insertions(+), 30 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 08d6fcdc40..fa22516e30 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,9 +6,4 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ USER vscode -RUN rustup default nightly-2023-04-15 && \ - rustup target add wasm32-unknown-unknown --toolchain nightly-2023-04-15 - -RUN rustup component add rustfmt - RUN git config --global submodule.recurse true diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 9f042bc1fe..93c28faaea 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -80,13 +80,7 @@ jobs: ~/.cargo/git/db/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2023-04-15 - components: rustfmt - target: wasm32-unknown-unknown - default: true + uses: dtolnay/rust-toolchain@nightly - name: Install weight-gen run: cargo install --git https://github.com/open-web3-stack/wasm-bencher.git --bin weight-gen --force - name: Setup cmake diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 495c0c51f5..92535772f9 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -69,7 +69,7 @@ jobs: # Build WASM with Substrate Runtime Tool - name: Srtool build id: srtool_build - uses: chevdor/srtool-actions@v0.7.0 + uses: chevdor/srtool-actions@v0.9.0 env: BUILD_OPTS: "--features on-chain-release-build,no-metadata-docs" with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7552415102..36a041f321 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,16 +37,12 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install toolchain uses: dtolnay/rust-toolchain@nightly - with: - components: rustfmt - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 - name: Check format run: cargo +nightly fmt --all -- --check - name: Build run: make build-all - - name: Install clippy - run: rustup component add clippy - name: Run mandala-runtime clippy run: cargo clippy --features with-mandala-runtime -- -D warnings - name: Run karura-runtime clippy diff --git a/.github/workflows/test.yml.src b/.github/workflows/test.yml.src index c5f239f1a5..6c51a7e3db 100644 --- a/.github/workflows/test.yml.src +++ b/.github/workflows/test.yml.src @@ -41,8 +41,6 @@ jobs: - &toolchain name: Install toolchain uses: dtolnay/rust-toolchain@nightly - with: - components: rustfmt - &cmake name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 @@ -50,8 +48,6 @@ jobs: run: cargo +nightly fmt --all -- --check - name: Build run: make build-all - - name: Install clippy - run: rustup component add clippy - name: Run mandala-runtime clippy run: cargo clippy --features with-mandala-runtime -- -D warnings - name: Run karura-runtime clippy diff --git a/scripts/Dockerfile b/scripts/Dockerfile index c8053685d1..5ff544d2bd 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -1,9 +1,6 @@ FROM rust:buster as builder WORKDIR /app -RUN rustup default nightly-2023-04-15 && \ - rustup target add wasm32-unknown-unknown --toolchain nightly-2023-04-15 - RUN apt-get update && \ apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ apt-get install -y cmake pkg-config libssl-dev git clang libclang-dev protobuf-compiler diff --git a/scripts/init.sh b/scripts/init.sh index 9a424454d2..b3f06e0167 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -4,6 +4,4 @@ set -e echo "*** Initializing WASM build environment" -rustup default nightly-2023-04-15 - -rustup target add wasm32-unknown-unknown --toolchain nightly-2023-04-15 +rustup show diff --git a/scripts/profiling/Dockerfile b/scripts/profiling/Dockerfile index 08563a05b6..3597477c0d 100644 --- a/scripts/profiling/Dockerfile +++ b/scripts/profiling/Dockerfile @@ -1,9 +1,6 @@ FROM rust:buster as builder WORKDIR /app -RUN rustup default nightly-2023-04-15 && \ - rustup target add wasm32-unknown-unknown --toolchain nightly-2023-04-15 - RUN apt-get update && \ apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \ apt-get install -y cmake pkg-config libssl-dev git clang libclang-dev protobuf-compiler From d7c283615dced27ed00028119f7aa11d45699c9f Mon Sep 17 00:00:00 2001 From: zjb0807 Date: Tue, 7 Nov 2023 20:12:06 +0800 Subject: [PATCH 2/2] fix CI --- .github/workflows/test.yml | 2 + .github/workflows/test.yml.src | 105 --------------------------------- scripts/init.sh | 2 + 3 files changed, 4 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/test.yml.src diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 36a041f321..4ece87347f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,6 +37,8 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install toolchain uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 - name: Check format diff --git a/.github/workflows/test.yml.src b/.github/workflows/test.yml.src deleted file mode 100644 index 6c51a7e3db..0000000000 --- a/.github/workflows/test.yml.src +++ /dev/null @@ -1,105 +0,0 @@ -# generate by yq eval 'explode(.)' test.yml.src > test.yml -# https://github.com/mikefarah/yq - -name: Test -on: - pull_request: - branches: - - master - - release-** - paths-ignore: - - '**/README.md' - push: - branches: - - master - - release-** - paths-ignore: - - '**/README.md' -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - build: &setup - runs-on: - [self-hosted, linux] - env: - CARGO_INCREMENTAL: 0 - steps: - - &checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - &cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - &toolchain - name: Install toolchain - uses: dtolnay/rust-toolchain@nightly - - &cmake - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 - - name: Check format - run: cargo +nightly fmt --all -- --check - - name: Build - run: make build-all - - name: Run mandala-runtime clippy - run: cargo clippy --features with-mandala-runtime -- -D warnings - - name: Run karura-runtime clippy - run: cargo clippy --features with-karura-runtime -- -D warnings - - name: Run acala-runtime clippy - run: cargo clippy --features with-acala-runtime -- -D warnings - - name: Run build benches - run: make build-benches - benchmarking: - <<: *setup - steps: - - *checkout - - *cache - - *toolchain - - name: Install cargo-nextest - uses: taiki-e/install-action@nextest - - *cmake - - name: Run benchmarking tests - run: make test-benchmarking - checks-and-tests: - <<: *setup - steps: - - *checkout - - *cache - - *toolchain - - name: Install cargo-nextest - uses: taiki-e/install-action@nextest - - *cmake - - name: Run runtime tests - run: make test-runtimes - - name: Run eth tests - run: make test-eth - - name: Check benchmarks - run: make check-benchmarks - - name: Check try-runtime - run: make check-try-runtime - - name: Check runtimes - run: make check-runtimes - e2e-tests: - <<: *setup - steps: - - *checkout - - *cache - - *toolchain - - *cmake - - name: Run e2e tests - run: make test-e2e - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 16.x - - name: Run ts tests - run: | - npm install -g yarn - make test-ts diff --git a/scripts/init.sh b/scripts/init.sh index b3f06e0167..a5e7899b8d 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -4,4 +4,6 @@ set -e echo "*** Initializing WASM build environment" +rustup component add rustfmt --toolchain nightly + rustup show