From 23488a464cdf98595557c536daa9f1b057c3243d Mon Sep 17 00:00:00 2001 From: Gianmarco Garrisi Date: Thu, 29 Feb 2024 22:14:37 +0100 Subject: [PATCH] Update workflows --- .github/workflows/build.yml | 39 ++++++++++++++++++++++++----- .github/workflows/format.yml | 21 ---------------- .github/workflows/static-checks.yml | 36 ++++++++++++++++++++++++++ .github/workflows/test.yml | 21 +++++++++++++--- 4 files changed, 86 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/format.yml create mode 100644 .github/workflows/static-checks.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c33d0ce..5bde1c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,15 +12,42 @@ env: jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + include: + - rust: stable + features: std + - rust: stable + features: serde + - rust: beta + features: + - rust: nightly + features: steps: - uses: actions/checkout@v2 - - run: rustup target add $TARGET + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - name: Build + run: cargo build --verbose --features "${{ matrix.features }}" + + nostd_build: + runs-on: ubuntu-latest + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + target: $TARGET - name: Build - run: cargo build --verbose - - name: Build with serde - run: cargo build --verbose --features serde - - name: Build for no-std run: cargo build -v -p test-nostd --target=$TARGET + + docs_rs_build: + runs-on: ubuntu-latest + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly + - name: Docs.rs + run: RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml deleted file mode 100644 index 901ec94..0000000 --- a/.github/workflows/format.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Format - -on: - push: - branches: [ "*" ] - pull_request: - branches: [ master ] - -env: - CARGO_TERM_COLOR: always - TARGET: thumbv6m-none-eabi - -jobs: - format: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Check format - run: cargo fmt --all -- --check diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml new file mode 100644 index 0000000..12e91d0 --- /dev/null +++ b/.github/workflows/static-checks.yml @@ -0,0 +1,36 @@ +name: Static checks + +on: + push: + branches: [ "*" ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Check format + run: cargo fmt --all -- --check + + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@beta + with: + components: clippy + - run: cargo clippy --all-features + + miri: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: miri + - run: cargo miri test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ceb50e..e6a510e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,13 +12,26 @@ env: jobs: test: - runs-on: ubuntu-latest + strategy: + matrix: + include: + - rust: stable + features: std + - rust: stable + features: serde + - rust: beta + features: + - rust: nightly + features: steps: - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} - name: Run tests - run: cargo test --verbose - - name: Run tests with serde - run: cargo test --verbose --features serde + run: cargo test --verbose --features "${{ matrix.features }}" + - name: Run tests in release mode + run: cargo test --release --verbose --features "${{ matrix.features }}"