From: Vihiga Tyonum Date: Tue, 6 Jan 2026 10:10:25 +0000 (+0100) Subject: ci: update cont_integration workflow X-Git-Url: http://internal-gitweb-vhost/parse/%22https:/struct.EncoderStringWriter.html?a=commitdiff_plain;h=8d20cf270d7e9fee71857135cb94b0d22a4b6565;p=bdk-cli ci: update cont_integration workflow - update actions/checkout to v6 - add separate job for clippy - automate manual caching in the build-test job - replace actions-r/toolchain with actions-rust- lang/setup-rust-toolchain for toolchain setup - update wasm job and replace build with check --- diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml index 9149663..90878f3 100644 --- a/.github/workflows/cont_integration.yml +++ b/.github/workflows/cont_integration.yml @@ -2,6 +2,10 @@ on: [push, pull_request] name: CI +permissions: + contents: read +env: + CARGO_TERM_COLOR: always jobs: build-test: @@ -17,78 +21,71 @@ jobs: - --all-features steps: - name: Checkout - uses: actions/checkout@v4 - - name: Generate cache key - run: echo "${{ matrix.rust }} ${{ matrix.features }}" | tee .cache_key - - name: Cache - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} + uses: actions/checkout@v6 - name: Setup Rust Toolchain - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: ${{ matrix.rust }} profile: minimal override: true components: rustfmt, clippy + cache: true - name: Build run: cargo build ${{ matrix.features }} - - name: Clippy - run: cargo clippy -- -D warnings - name: Test run: cargo test ${{ matrix.features }} + clippy: + name: Clippy (${{ matrix.features }}) + runs-on: ubuntu-latest + strategy: + matrix: + features: + - --no-default-features + - --all-features + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + components: clippy + cache: true + - name: Run Clippy + run: cargo clippy ${{ matrix.features }} --all-targets -- -D warnings -# TODO: fix or remove this -# wasm-build: -# name: Build WASM -# runs-on: ubuntu-20.04 -# env: -# CC: clang-10 -# CFLAGS: -I/usr/include -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: Generate cache key -# run: echo "Build WASM" | tee .cache_key -# - name: Cache -# uses: actions/cache@v4 -# with: -# path: | -# ~/.cargo/registry -# ~/.cargo/git -# target -# key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }} -# # Install a recent version of clang that supports wasm32 -# - run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || 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 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: Build -# run: cargo build --target wasm32-unknown-unknown --no-default-features --features esplora,compiler,dev-getrandom-wasm - + wasm-build: + name: Check WASM + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Install Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + cache: true + target: wasm32-unknown-unknown + - name: Check WASM + run: cargo check --target wasm32-unknown-unknown --no-default-features --features esplora,compiler fmt: name: Rust fmt runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Rust Toolchain - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable profile: minimal override: true components: rustfmt, clippy + cache: true - name: Check fmt run: cargo fmt --all -- --check