From 05ee96d1c3328d0b91e68b8f5cf6fcc5c62f960c Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (Ferrous Systems)" Date: Fri, 26 Jan 2024 15:04:51 +0000 Subject: [PATCH 1/2] Add some Github Actions. Tests compilation across a selection of targets, to ensure no raw CAS operations are included (only via portable-atomic, which can use critical-section to emulate them) --- .github/workflows/clippy.toml | 15 ++++++++++++ .github/workflows/format.yml | 15 ++++++++++++ .github/workflows/rust.yml | 44 +++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 .github/workflows/clippy.toml create mode 100644 .github/workflows/format.yml create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/clippy.toml b/.github/workflows/clippy.toml new file mode 100644 index 0000000..942e19e --- /dev/null +++ b/.github/workflows/clippy.toml @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2024 Jonathan 'theJPster' Pallant +# +# SPDX-License-Identifier: MIT OR Apache-2.0 + +name: Clippy + +on: [push, pull_request] + +jobs: + cargo-clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run Clippy + run: cargo clippy diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..4f1be18 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2024 Jonathan 'theJPster' Pallant +# +# SPDX-License-Identifier: MIT OR Apache-2.0 + +name: Format + +on: [push, pull_request] + +jobs: + cargo-fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup component add rustfmt + - run: cargo fmt -- --check diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..51c12c7 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: 2024 Jonathan 'theJPster' Pallant +# +# SPDX-License-Identifier: MIT OR Apache-2.0 + +name: Build and Test + +on: [push, pull_request] + +jobs: + cargo-build-native: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + cargo build + cargo build --all-features + cargo-build-cross: + runs-on: ubuntu-latest + strategy: + matrix: + target: [thumbv6m-none-eabi, riscv32i-unknown-none-elf, thumbv7m-none-eabi, thumbv7em-none-eabi, thumbv8m.base-none-eabi, thumbv8m.main-none-eabi, riscv32imac-unknown-none-elf] + steps: + - uses: actions/checkout@v4 + - run: rustup target add ${{ matrix.target }} + - run: | + cargo build --target=${{ matrix.target }} + cargo build --target=${{ matrix.target }} --features=cas,critical-section + cargo-build-cross-with-cas: + runs-on: ubuntu-latest + strategy: + matrix: + target: [thumbv7m-none-eabi, thumbv7em-none-eabi, thumbv8m.base-none-eabi, thumbv8m.main-none-eabi, riscv32imac-unknown-none-elf] + steps: + - uses: actions/checkout@v4 + - run: rustup target add ${{ matrix.target }} + - run: | + cargo build --target=${{ matrix.target }} --features=cas + cargo-test-native: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + cargo test + cargo test --all-features From e623eafe222cfa85b241f743d41c881b80362903 Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (Ferrous Systems)" Date: Fri, 26 Jan 2024 15:34:22 +0000 Subject: [PATCH 2/2] Rename to clippy.yml --- .github/workflows/{clippy.toml => clippy.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{clippy.toml => clippy.yml} (100%) diff --git a/.github/workflows/clippy.toml b/.github/workflows/clippy.yml similarity index 100% rename from .github/workflows/clippy.toml rename to .github/workflows/clippy.yml