diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d594f7..ff2e225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,30 +1,61 @@ on: - push: # Run CI for all branches except GitHub merge queue tmp branches - branches-ignore: - - "gh-readonly-queue/**" pull_request: # Run CI for PRs on any branch merge_group: # Run CI for the GitHub merge queue + workflow_dispatch: # Run CI when manually requested name: Continuous integration jobs: - ci: + check: runs-on: ubuntu-latest + env: {"RUSTFLAGS": "-D warnings"} strategy: matrix: target: - thumbv6m-none-eabi - thumbv7m-none-eabi + toolchain: + - stable + - nightly steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master with: - profile: minimal - toolchain: stable - target: ${{ matrix.target }} - override: true - - uses: actions-rs/cargo@v1 + targets: ${{ matrix.target }} + toolchain: ${{ matrix.toolchain }} + - run: cargo check --target=${{ matrix.target }} --examples + - if: ${{ matrix.toolchain == 'nightly' }} + run: cargo check --target=${{ matrix.target }} --examples --all-features + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: clippy + toolchain: nightly + targets: thumbv6m-none-eabi + - run: cargo clippy --all-features --examples --target=thumbv6m-none-eabi -- --deny warnings + + format: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly with: - command: check - args: --target=${{ matrix.target }} --examples + components: rustfmt + - run: cargo fmt -- --check + + rustdoc: + name: rustdoc + runs-on: ubuntu-latest + env: {"RUSTDOCFLAGS": "-D warnings"} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - name: rustdoc + run: cargo rustdoc --all-features diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml deleted file mode 100644 index 0fe9b23..0000000 --- a/.github/workflows/clippy.yml +++ /dev/null @@ -1,28 +0,0 @@ -on: - push: # Run CI for all branches except GitHub merge queue tmp branches - branches-ignore: - - "gh-readonly-queue/**" - pull_request: # Run CI for PRs on any branch - merge_group: # Run CI for the GitHub merge queue - -name: Clippy check - -jobs: - clippy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - if: github.event_name == 'pull_request_target' - with: - ref: refs/pull/${{ github.event.number }}/head - - uses: actions/checkout@v2 - if: github.event_name != 'pull_request_target' - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: clippy - - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index baaa18c..ec46eb6 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -9,18 +9,12 @@ jobs: ci-cron: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable - target: thumbv6m-none-eabi - override: true - - uses: actions-rs/cargo@v1 - with: - command: check - args: --examples --target thumbv6m-none-eabi - - uses: imjohnbo/issue-bot@v2 + targets: thumbv6m-none-eabi + - run: cargo check --examples --target thumbv6m-none-eabi + - uses: imjohnbo/issue-bot@v3 if: failure() with: title: CI Failure diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml deleted file mode 100644 index 714f503..0000000 --- a/.github/workflows/rustfmt.yml +++ /dev/null @@ -1,24 +0,0 @@ -on: - push: # Run CI for all branches except GitHub merge queue tmp branches - branches-ignore: - - "gh-readonly-queue/**" - pull_request: # Run CI for PRs on any branch - merge_group: # Run CI for the GitHub merge queue - -name: Code formatting check - -jobs: - rustfmt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check diff --git a/README.md b/README.md index a7ea481..5fd93d7 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,8 @@ Please refer to the documentation of [`critical-section`](https://docs.rs/critic Licensed under either of - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or - http://www.apache.org/licenses/LICENSE-2.0) -- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + ) +- MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. diff --git a/examples/global_alloc.rs b/examples/global_alloc.rs index 63a16e7..812c9f1 100644 --- a/examples/global_alloc.rs +++ b/examples/global_alloc.rs @@ -24,6 +24,7 @@ fn main() -> ! { let mut xs = Vec::new(); xs.push(1); + #[allow(clippy::empty_loop)] loop { /* .. */ } }