-
Notifications
You must be signed in to change notification settings - Fork 0
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 #5 from Systemscape/add-ci
Add CI Workflow first version
- Loading branch information
Showing
1 changed file
with
78 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |