-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from jscatena88/integrate-cargo-make
- Loading branch information
Showing
11 changed files
with
263 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Test builds without cargo-make | ||
# Not the recommended path, but should make sure it still works | ||
name: Traditional Cargo Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- dev-* | ||
paths-ignore: | ||
- '*.py' | ||
pull_request: | ||
branches: | ||
- '*' | ||
paths-ignore: | ||
- '*.py' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
|
||
jobs: | ||
firmware: | ||
name: Building | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Rust toolchain | ||
run: rustup show | ||
|
||
- run: cargo install flip-link | ||
|
||
- run: cargo build -p ledmatrix | ||
- run: cargo build -p b1display | ||
- run: cargo build -p c1minimal | ||
|
||
linux-software: | ||
name: Build Linux | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libudev-dev libasound2-dev | ||
- name: Setup Rust toolchain | ||
run: rustup show | ||
|
||
- name: Build tool | ||
run: cargo build --release --target x86_64-unknown-linux-gnu -p inputmodule-control | ||
|
||
- name: Check if tool can start | ||
run: cargo run --release --target x86_64-unknown-linux-gnu -p inputmodule-control -- --help | grep 'RAW HID and VIA commandline' | ||
|
||
windows-software: | ||
name: Build Windows | ||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Rust toolchain | ||
run: rustup show | ||
|
||
- run: cargo install cargo-make | ||
|
||
- name: Build tool | ||
run: cargo build --release --target x86_64-pc-windows-msvc -p inputmodule-control | ||
|
||
- name: Check if tool can start | ||
run: cargo run --release --target x86_64-pc-windows-msvc -p inputmodule-control -- --help | grep 'RAW HID and VIA commandline' | ||
|
||
lint-format: | ||
name: Lint and format check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libudev-dev libasound2-dev | ||
- name: Setup Rust toolchain | ||
run: rustup show | ||
|
||
- name: Firmware clippy | ||
run: | | ||
cargo clippy -p b1display -- --deny=warnings | ||
cargo clippy -p c1minimal -- --deny=warnings | ||
cargo clippy -p ledmatrix -- --deny=warnings | ||
- name: Software clippy | ||
run: cargo clippy --target x86_64-unknown-linux-gnu -p inputmodule-control -- -D warnings | ||
|
||
- name: All cargo fmt | ||
run: cargo fmt --all -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[env] | ||
TARGET_TRIPLE = "thumbv6m-none-eabi" | ||
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true | ||
FEATURES = "" | ||
|
||
[tasks.build] | ||
args = [ | ||
"build", | ||
"@@remove-empty(BUILD_TYPE)", | ||
"--target", | ||
"${TARGET_TRIPLE}", | ||
"--features", | ||
"${FEATURES}", | ||
] | ||
|
||
[tasks.build-release] | ||
clear = true | ||
env.BUILD_TYPE = "--release" | ||
run_task = "build" | ||
|
||
[tasks.test] | ||
disabled = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extend = "../Makefile.toml" | ||
|
||
[tasks.uf2] | ||
command = "elf2uf2-rs" | ||
args = ["../target/thumbv6m-none-eabi/release/b1display", "../target/thumbv6m-none-eabi/release/b1display.uf2"] | ||
dependencies = ["build-release"] | ||
install_crate = "elf2uf2-rs" | ||
|
||
[tasks.bin] | ||
command = "llvm-objcopy" | ||
args = ["-Obinary", "../target/thumbv6m-none-eabi/release/b1display", "../target/thumbv6m-none-eabi/release/b1display.bin"] | ||
dependencies = ["build-release"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extend = "../Makefile.toml" | ||
|
||
[tasks.uf2] | ||
command = "elf2uf2-rs" | ||
args = ["../target/thumbv6m-none-eabi/release/c1minimal", "../target/thumbv6m-none-eabi/release/c1minimal.uf2"] | ||
dependencies = ["build-release"] | ||
install_crate = "elf2uf2-rs" | ||
|
||
[tasks.bin] | ||
command = "llvm-objcopy" | ||
args = ["-Obinary", "../target/thumbv6m-none-eabi/release/c1minimal", "../target/thumbv6m-none-eabi/release/c1minimal.bin"] | ||
dependencies = ["build-release"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
extend = "../Makefile.toml" | ||
|
||
[tasks.build-all] | ||
run_task = { name = [ | ||
"build-ledmatrix", | ||
"build-b1display", | ||
"build-c1minimal", | ||
], parallel = true } | ||
|
||
|
||
[tasks.build-ledmatrix] | ||
env.FEATURES = "ledmatrix" | ||
run_task = "build" | ||
|
||
[tasks.build-b1display] | ||
env.FEATURES = "b1display" | ||
run_task = "build" | ||
|
||
[tasks.build-c1minimal] | ||
env.FEATURES = "c1minimal" | ||
run_task = "build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
extend = "../Makefile.toml" | ||
|
||
# Since it's a tool, build it for the platform we're running on | ||
[env] | ||
TARGET_TRIPLE = "${CARGO_MAKE_RUST_TARGET_TRIPLE}" | ||
|
||
[tasks.run] | ||
command = "cargo" | ||
args = [ | ||
"run", | ||
"--target", | ||
"${CARGO_MAKE_RUST_TARGET_TRIPLE}", | ||
"${@}", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extend = "../Makefile.toml" | ||
|
||
[tasks.uf2] | ||
command = "elf2uf2-rs" | ||
args = ["../target/thumbv6m-none-eabi/release/ledmatrix", "../target/thumbv6m-none-eabi/release/ledmatrix.uf2"] | ||
dependencies = ["build-release"] | ||
install_crate = "elf2uf2-rs" | ||
|
||
[tasks.bin] | ||
command = "llvm-objcopy" | ||
args = ["-Obinary", "../target/thumbv6m-none-eabi/release/ledmatrix", "../target/thumbv6m-none-eabi/release/ledmatrix.bin"] | ||
dependencies = ["build-release"] |