From aec0e173243cfb130b8ca78e59ecd1790022f688 Mon Sep 17 00:00:00 2001 From: Nidhi Gahlawat Date: Sat, 29 Aug 2026 12:48:01 +0530 Subject: [PATCH] ci: use default Rust workflow --- .github/workflows/{main.yml => rust.yml} | 69 ++++++++++++------------ 1 file changed, 34 insertions(+), 35 deletions(-) rename .github/workflows/{main.yml => rust.yml} (61%) diff --git a/.github/workflows/main.yml b/.github/workflows/rust.yml similarity index 61% rename from .github/workflows/main.yml rename to .github/workflows/rust.yml index fe8a43d..7e675e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/rust.yml @@ -1,4 +1,4 @@ -name: CI +name: Rust on: push: @@ -8,80 +8,80 @@ on: types: [checks_requested] workflow_dispatch: +env: + CARGO_TERM_COLOR: always + jobs: - linux-ci: - name: Linux + build: + name: Build and test (${{ matrix.name }}) runs-on: ubuntu-latest strategy: matrix: - toolchain: ["stable", "beta", "nightly", "1.83.0"] include: - - toolchain: stable - fuzz: 1 - - toolchain: beta - fuzz: 1 + - name: stable + toolchain: stable + fuzz: true + - name: beta + toolchain: beta + fuzz: true + - name: nightly + toolchain: nightly + nightly: true + - name: MSRV + toolchain: "1.83.0" + - name: no_std + toolchain: stable + target: thumbv7m-none-eabi + no_std: true steps: - uses: actions/checkout@v4 - name: Install packages for fuzzing - if: runner.os == 'Linux' && matrix.fuzz == 1 + if: matrix.fuzz run: sudo apt-get update -y && sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev - name: Install toolchain uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} - + target: ${{ matrix.target }} + - name: Style check - if: matrix.toolchain == 'nightly' + if: matrix.nightly run: rustup component add rustfmt && cargo fmt --all --check - - name: Cargo build + - name: Build run: cargo build --verbose - - name: Cargo test no features + - name: Run tests + if: ${{ !matrix.no_std }} run: cargo test --verbose - name: Cargo test all features - if: matrix.toolchain == 'nightly' + if: matrix.nightly run: cargo test --verbose --all-features - name: Cargo doc all features - if: matrix.toolchain == 'nightly' + if: matrix.nightly run: cargo doc --all-features --verbose - name: Cargo bench all features - if: matrix.toolchain == 'nightly' + if: matrix.nightly run: cargo bench --verbose --all-features - name: miri - if: matrix.toolchain == 'nightly' + if: matrix.nightly run: rustup component add miri && cargo miri test --verbose --all-features - name: fuzz - if: matrix.fuzz == 1 + if: matrix.fuzz working-directory: fuzz run: ./travis-fuzz.sh - no-std: - name: no_std - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - target: thumbv7m-none-eabi - - name: Cargo build - run: cargo build --verbose - build_result: name: homu build finished runs-on: ubuntu-latest - needs: - - "linux-ci" - - "no-std" + needs: build steps: - name: Mark the job as successful @@ -90,4 +90,3 @@ jobs: - name: Mark the job as unsuccessful run: exit 1 if: "!success()" -