From 48dc2e1baa996f66115bdc7ba9a7dc80909a44e0 Mon Sep 17 00:00:00 2001 From: Kesavan Yogeswaran Date: Sat, 1 Jun 2024 12:19:12 -0400 Subject: [PATCH] Add CI via GitHub Actions --- .github/workflows/rust.yml | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..9eb1c4b --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,61 @@ +name: Rust + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + +jobs: + device: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: clippy + targets: "thumbv7em-none-eabihf" + - name: Build nrf52832 + run: cargo build --verbose --release --bin proto1_0 --bin calibration_p1 --bin blinky_p1 --features nrf52832 + working-directory: hangman + - name: Build nrf52840 + run: cargo build --release --bin proto0_0 --bin calibration_p0 --bin blinky_p0 --bin dongle --features nrf52840 --no-default-features + working-directory: hangman + - name: Clippy nrf52832 + run: cargo clippy --bin proto1_0 --bin calibration_p1 --bin blinky_p1 --features nrf52832 + working-directory: hangman + - name: Clippy nrf52840 + run: cargo clippy --bin proto0_0 --bin calibration_p0 --bin blinky_p0 --bin dongle --features nrf52840 --no-default-features + working-directory: hangman + host: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: clippy + - name: Build hangman_utils + run: cargo build + working-directory: hangman_utils + - name: Clippy hangman_utils + run: cargo clippy + working-directory: hangman_utils + - name: Test + run: cargo test --verbose + working-directory: hangman_utils + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + - name: rustfmt hangman + run: cargo fmt --check + working-directory: hangman + - name: rustfmt hangman_utils + run: cargo fmt --check + working-directory: hangman_utils