From bcefec7977b195e162bffb074423812a16794a44 Mon Sep 17 00:00:00 2001 From: JuliDi <20155974+JuliDi@users.noreply.github.com> Date: Fri, 28 Jun 2024 20:40:29 +0200 Subject: [PATCH] add first draft of ci workflow --- .github/workflows/build.yaml | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..6cb045e --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,78 @@ +name: Compile and Test + +on: + pull_request: + merge_group: + workflow_dispatch: + push: + tags: + - '*' + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: '--deny warnings' + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + target: thumbv7em-none-eabi + - run: cargo fmt -- --check + + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + target: thumbv7em-none-eabi + - run: cargo clippy --no-deps -- -Dwarnings + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy, rust-src + - run: cargo test + + test-all-features: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo test --all-features + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + target: thumbv7em-none-eabi + - run: > + cargo build + --target thumbv7m-none-eabi + --all-features + + release: + runs-on: ubuntu-latest + steps: + - name: version + run: echo "version=$(cargo pkgid | cut -d '#' -f2)" >> $GITHUB_OUTPUT + id: version + - name: Release + uses: actions/create-release@v1 + id: create_release + with: + draft: false + prerelease: false + release_name: ${{ steps.version.outputs.version }} + tag_name: ${{ github.ref }} + #body_path: CHANGELOG.md + env: + GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file