From 69a3b1d8f32bce23b8e59203dbf1e0a1c179009f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 May 2024 14:12:26 +0200 Subject: [PATCH 1/3] update github CI --- .github/workflows/ci.yml | 114 ++++++++++++--------------------------- 1 file changed, 35 insertions(+), 79 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6218e5a..5c45e7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,42 +1,38 @@ -on: [push] - name: ci +on: [push, pull_request] jobs: check: - name: Check + name: Check build strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - uses: actions-rs/cargo@v1 - with: - command: check - args: --release + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --release - msrv: - name: Check with MSRV + test: + name: Run Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.65.0 - override: true - profile: minimal - - uses: actions-rs/cargo@v1 - with: - command: check - args: --release + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Install nextest + uses: taiki-e/install-action@nextest + - run: cargo nextest run --all-features + + msrv: + name: Check MSRV + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.65.0 + - run: cargo check --release cross-check: - name: Check Cross + name: Check Cross-Compilation runs-on: ubuntu-latest strategy: matrix: @@ -44,70 +40,30 @@ jobs: - armv7-unknown-linux-gnueabihf - thumbv7em-none-eabihf steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - target: ${{ matrix.target }} - override: true - - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: check - args: --release --target=${{ matrix.target }} --no-default-features + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --release --target=${{ matrix.target }} --no-default-features fmt: - name: Rustfmt + name: Check formatting runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo fmt --all -- --check - check-doc: + docs: name: Check Documentation Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - profile: minimal - - uses: actions-rs/cargo@v1 - with: - command: doc - args: --all-features + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - run: cargo +nightly doc --all-features --config 'build.rustdocflags=["--cfg", "docs_rs"]' clippy: name: Clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - run: rustup component add clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings - - ci: - if: ${{ success() }} - # all new jobs must be added to this list - needs: [check, fmt, clippy] - runs-on: ubuntu-latest - steps: - - name: CI succeeded - run: exit 0 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@latest + - run: cargo clippy -- -D warnings From b78bfe2114d11ff14fa0ca62dc3e517d4d47108e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 May 2024 14:16:20 +0200 Subject: [PATCH 2/3] some fixes --- .github/workflows/ci.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c45e7c..cfef7ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,15 +34,12 @@ jobs: cross-check: name: Check Cross-Compilation runs-on: ubuntu-latest - strategy: - matrix: - target: - - armv7-unknown-linux-gnueabihf - - thumbv7em-none-eabihf steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - - run: cargo check --release --target=${{ matrix.target }} --no-default-features + with: + targets: "armv7-unknown-linux-gnueabihf, thumbv7em-none-eabihf" + - run: cargo check --release --no-default-features fmt: name: Check formatting @@ -65,5 +62,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@latest + - uses: dtolnay/rust-toolchain@stable - run: cargo clippy -- -D warnings From af392d40d061b9df8cfa94e5fad1b25d84c2be9b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 2 May 2024 14:22:03 +0200 Subject: [PATCH 3/3] this might work --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfef7ef..bfebe86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,12 +34,17 @@ jobs: cross-check: name: Check Cross-Compilation runs-on: ubuntu-latest + strategy: + matrix: + target: + - armv7-unknown-linux-gnueabihf + - thumbv7em-none-eabihf steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: targets: "armv7-unknown-linux-gnueabihf, thumbv7em-none-eabihf" - - run: cargo check --release --no-default-features + - run: cargo check --release --target=${{matrix.target}} --no-default-features fmt: name: Check formatting