From 61079fa7f6c1a9346849d2e8e192aa88376faa35 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 16 Sep 2024 20:12:33 +0200 Subject: [PATCH] Add CI workflow --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a82870a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + target: + - thumbv7em-none-eabi + - thumbv6m-none-eabi # like the Cortex-M0+ + - x86_64-unknown-linux-gnu + - x86_64-pc-windows-msvc + + steps: + - name: Install build dependencies + shell: bash + run: | + env && pwd && sudo apt-get update -y -qq && sudo apt-get install -y -qq llvm libc6-dev-i386 libclang-dev + - uses: fiam/arm-none-eabi-gcc@v1 + with: + release: "9-2020-q2" + + - uses: actions/checkout@v3 + + - name: Check + run: | + cargo check + cargo check --all-features + + - name: Build + run: cargo build --release + + - name: Run clippy + if: matrix.target == 'x86_64-unknown-linux-gnu' + run: cargo clippy --workspace --all-features --all-targets -- --deny warnings + + - name: Check code format + if: matrix.target == 'x86_64-unknown-linux-gnu' + run: cargo fmt --all -- --check