From 9325f764b1073c4200de6a6641613ef55da64d00 Mon Sep 17 00:00:00 2001 From: wcampbell Date: Wed, 27 Dec 2023 15:56:20 -0500 Subject: [PATCH] Update CI; Test MSRV --- .github/workflows/coverage.yml | 11 +-- .github/workflows/main.yml | 118 ++++++----------------------- .github/workflows/pull_request.yml | 6 +- 3 files changed, 31 insertions(+), 104 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e2564bff..ec5f1d45 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -8,15 +8,16 @@ jobs: env: CARGO_TERM_COLOR: always steps: - - uses: actions/checkout@v3 - - name: Install Rust - run: rustup update stable + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master + with: + toolchain: stable - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov + uses: taiki-e/install-action@e8c64729e2a2a2c3cfa6751fa496b34ca19f390c # cargo-llvm-cov - name: Generate code coverage run: cargo llvm-cov --workspace --codecov --output-path codecov.json - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4 with: files: codecov.json fail_ci_if_error: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b3c36a2..7065591c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,127 +3,55 @@ on: [push, pull_request] name: CI jobs: - check: - name: Build + build: runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + # msrv + - 1.56.0 steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: build - args: --all - - test: - name: Test Suite - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all + toolchain: ${{ matrix.toolchain }} -# TODO: Enable Miri -# test_miri: -# name: Miri Test -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions-rs/toolchain@v1 -# with: -# toolchain: nightly -# override: true -# components: miri -# - run: cargo miri test -# -# test_miri_big_endian: -# name: Miri Test Big Endian -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions-rs/toolchain@v1 -# with: -# toolchain: nightly -# override: true -# components: miri -# target: armebv7r-none-eabi -# - run: cargo miri test --target armebv7r-none-eabi - - examples: - name: Examples - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + # build + - run: cargo build --all + # test + - run: cargo test --all + # run examples - run: cargo run --example 2>&1 | grep -P ' ' | awk '{print $1}' | xargs -i cargo run --example {} - fmt: - name: Rustfmt + fmt-clippy-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master with: - profile: minimal toolchain: stable - override: true - - run: rustup component add rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - clippy: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + - run: cargo clippy -- -D warnings + - run: cargo fmt --all -- --check ensure_no_std: name: Ensure no_std runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master with: toolchain: nightly - override: true - target: thumbv7em-none-eabihf - run: cd ensure_no_std && cargo build --release --target thumbv7em-none-eabihf ensure_wasm: name: Ensure wasm runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master with: toolchain: nightly - override: true - uses: jetli/wasm-pack-action@v0.3.0 with: version: 'latest' diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 76f07e0f..3c59154c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,14 +5,12 @@ jobs: name: Benchmark runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # master with: - profile: minimal toolchain: stable - override: true - uses: boa-dev/criterion-compare-action@v3 with: branchName: ${{ github.base_ref }}