diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 644da68..e74e57e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,18 +10,32 @@ on: - main - "release/**" +permissions: + contents: read + jobs: fmt: name: Check Formatting (hexaGenMini) runs-on: ubuntu-latest + defaults: + run: + working-directory: firmware steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + # Toolchain + components (rustfmt, clippy) + RP2040 target - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt,clippy + targets: thumbv6m-none-eabi + + # Cache to speed up builds + - name: Cache cargo + uses: Swatinem/rust-cache@v2 with: - toolchain: stable - override: true + workspaces: | + firmware - name: Check code formatting run: cargo fmt -- --check @@ -29,44 +43,72 @@ jobs: clippy: name: Run Clippy Linter (hexaGenMini) runs-on: ubuntu-latest + defaults: + run: + working-directory: firmware steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + targets: thumbv6m-none-eabi + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 with: - toolchain: stable - override: true + workspaces: | + firmware - - name: Run Clippy - run: cargo clippy --all-targets --all-features -- -D warnings + - name: Run Clippy (RP2040 target) + run: cargo clippy --target thumbv6m-none-eabi -- -D warnings build: - name: Build Project (hexaGenMini) + name: Build (hexaGenMini) runs-on: ubuntu-latest + defaults: + run: + working-directory: firmware steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true + targets: thumbv6m-none-eabi - - name: Build - run: cargo build --locked --all-targets + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + with: + workspaces: | + firmware + + # Eğer projenizde extra llvm-tools vs. gerekiyorsa burada ekleyebilirsiniz + # - run: rustup component add llvm-tools-preview + + - name: Build (hexaGenMini) + run: cargo build --release --target thumbv6m-none-eabi - test: - name: Run Tests (hexaGenMini) + check: + name: Check compiles (hexaGenMini) runs-on: ubuntu-latest + defaults: + run: + working-directory: firmware steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable + with: + targets: thumbv6m-none-eabi + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 with: - toolchain: stable - override: true + workspaces: | + firmware - - name: Run tests - run: cargo test --locked --all-targets + - name: Cargo check (RP2040 target) + run: cargo check --target thumbv6m-none-eabi diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 865b751..bd7cdf9 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -17,5 +17,5 @@ jobs: - name: Lint commits uses: wagoid/commitlint-github-action@v5 with: - configFile: .commitlintrc.yml + configFile: .github/.commitlintrc.yml failOnWarnings: true diff --git a/README.md b/README.md index 63e1a7c..cca41ed 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -# hexaGenMini \ No newline at end of file + + +# hexaGenMini + diff --git a/REUSE.toml b/REUSE.toml index e850e3e..b2b7395 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -1,7 +1,23 @@ version = 1 [[annotations]] -path = ["package.json", "CHANGELOG.md"] +path = ["package.json", "CHANGELOG.md", ".gitignore", "docs/CNAME"] +precedence = "aggregate" +SPDX-FileCopyrightText = "2025 hexaTune LLC" +SPDX-License-Identifier = "MIT" + +[[annotations]] +path = ["hardware/**", "mechanic/**"] +precedence = "aggregate" +SPDX-FileCopyrightText = "2025 hexaTune LLC" +SPDX-License-Identifier = "MIT" + +[[annotations]] +path = [ + "firmware/.cargo/config.toml", + "firmware/Cargo.lock", + "firmware/memory.x", +] precedence = "aggregate" SPDX-FileCopyrightText = "2025 hexaTune LLC" SPDX-License-Identifier = "MIT" diff --git a/firmware/Makefile b/firmware/Makefile index e9aadc7..39bb0f2 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -1,3 +1,5 @@ +# SPDX-FileCopyrightText: 2025 hexaTune LLC +# SPDX-License-Identifier: MIT # ===== User config ===== BIN ?= hexagenmini TRIPLE ?= thumbv6m-none-eabi diff --git a/firmware/build.rs b/firmware/build.rs index 3f915f9..0e0de19 100644 --- a/firmware/build.rs +++ b/firmware/build.rs @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2025 hexaTune LLC +// SPDX-License-Identifier: MIT + //! This build script copies the `memory.x` file from the crate root into //! a directory where the linker can always find it at build time. //! For many projects this is optional, as the linker always searches the diff --git a/firmware/src/main.rs b/firmware/src/main.rs index d6d6e9c..8caf0f5 100644 --- a/firmware/src/main.rs +++ b/firmware/src/main.rs @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2025 hexaTune LLC +// SPDX-License-Identifier: MIT + #![no_std] #![no_main] diff --git a/firmware/src/usb/mod.rs b/firmware/src/usb/mod.rs index 54ecc15..62cd45c 100644 --- a/firmware/src/usb/mod.rs +++ b/firmware/src/usb/mod.rs @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: 2025 hexaTune LLC +// SPDX-License-Identifier: MIT + use defmt::info; use embassy_usb::class::midi::MidiClass; use embassy_usb::{Builder, Config};