From dfcbafd6b10746a967c63e7a835ba07ac990e828 Mon Sep 17 00:00:00 2001 From: Daniela Brozzoni Date: Fri, 3 Mar 2023 15:59:02 +0100 Subject: [PATCH] Use action-rs/toolchain in CI --- .github/workflows/code_coverage.yml | 18 ++++------ .github/workflows/cont_integration.yml | 46 ++++++++++++-------------- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 0041cfea..dace6f35 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -16,16 +16,13 @@ jobs: uses: actions/checkout@v2 - name: Install lcov tools run: sudo apt-get install lcov -y - - name: Install rustup - run: curl https://sh.rustup.rs -sSf | sh -s -- -y - - name: Set default toolchain - run: rustup default nightly - - name: Set profile - run: rustup set profile minimal - - name: Add llvm tools - run: rustup component add llvm-tools-preview - - name: Update toolchain - run: rustup update + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: "1.65.0" + override: true + profile: minimal + components: llvm-tools-preview - name: Cache cargo uses: actions/cache@v3 with: @@ -53,7 +50,6 @@ jobs: run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info - name: Generate HTML coverage report run: genhtml -o coverage-report.html ./coverage/lcov.info - - name: Coveralls upload uses: coverallsapp/github-action@master with: diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index f401eb9f..4ce2ad47 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -30,15 +30,13 @@ jobs: ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} - - name: Set default toolchain - run: rustup default ${{ matrix.rust.version }} - - name: Set profile - run: rustup set profile minimal - - name: Add clippy - if: ${{ matrix.rust.clippy }} - run: rustup component add clippy - - name: Update toolchain - run: rustup update + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust.version }} + override: true + components: clippy + profile: minimal - name: Build run: cargo build ${{ matrix.features }} - name: Clippy @@ -69,14 +67,13 @@ jobs: - run: sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main" || exit 1 - run: sudo apt-get update || exit 1 - run: sudo apt-get install -y libclang-common-10-dev clang-10 libc6-dev-i386 || exit 1 - - name: Set default toolchain - run: rustup default 1.65.0 # STABLE - - name: Set profile - run: rustup set profile minimal - - name: Add target wasm32 - run: rustup target add wasm32-unknown-unknown - - name: Update toolchain - run: rustup update + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: "1.65.0" + override: true + profile: minimal + target: "wasm32-unknown-unknown" - name: Check bdk working-directory: ./crates/bdk run: cargo check --target wasm32-unknown-unknown --features dev-getrandom-wasm @@ -90,13 +87,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Set default toolchain - run: rustup default nightly - - name: Set profile - run: rustup set profile minimal - - name: Add rustfmt - run: rustup component add rustfmt - - name: Update toolchain - run: rustup update + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: "1.65.0" + override: true + profile: minimal + components: rustfmt - name: Check fmt run: cargo fmt --all -- --config format_code_in_doc_comments=true --check