Merge pull request #5 from cdaringe/feat/hal-1.0.0 #48
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
name: tmc2209 | |
on: [push, pull_request] | |
jobs: | |
# Check for standard formatting. | |
rustfmt-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- name: Run rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: -p tmc2209 -- --check | |
# Build and test the crate. | |
cargo-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: cargo test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: -p tmc2209 --verbose | |
- name: cargo test features | |
run: cd tmc2209 && cargo test --features "serde" && cd .. | |
# Check the docs build. | |
cargo-doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: cargo doc | |
uses: actions-rs/cargo@v1 | |
with: | |
command: doc | |
args: -p tmc2209 --verbose | |
# Auto-publish to crates.io. | |
cargo-publish: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
env: | |
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install stable | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Cargo publish tmc2209 | |
continue-on-error: true | |
run: cargo publish --token $CRATESIO_TOKEN --manifest-path tmc2209/Cargo.toml |