Merge branch 'master' into renovate/embedded-hal-1.x #548
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: CI | |
on: | |
push: | |
jobs: | |
audit: | |
name: Audit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions-rust-lang/audit@v1 | |
docs: | |
name: Docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Install Toolchains | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: 'stable' | |
target: 'thumbv7em-none-eabihf' | |
- name: Cargo Doc | |
run: cargo doc --verbose --no-deps --document-private-items --features=xmc4100 | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Install nightly toolchain with rustfmt available | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt | |
- name: Run cargo fmt | |
uses: actions-rust-lang/rustfmt@v1 | |
# test: | |
# needs: [format, docs] | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# rust-channel: [ 'stable', 'nightly' ] | |
# rust-target: [ 'x86_64-unknown-linux-gnu', 'thumbv7em-none-eabihf' ] | |
# device: ['xmc4100', 'xmc4200', 'xmc4300', 'xmc4400', 'xmc4500', 'xmc4700', 'xmc4800'] | |
# name: Test-${{ matrix.rust-channel }}-x86_64-unknown-linux-gnu-${{ matrix.device }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/[email protected] | |
# - name: Install toolchain | |
# uses: actions-rust-lang/setup-rust-toolchain@v1 | |
# with: | |
# toolchain: ${{ matrix.rust-channel }} | |
# target: 'x86_64-unknown-linux-gnu' | |
# - name: Cargo Test | |
# run: cargo test --lib --target x86_64-unknown-linux-gnu --features ${{ matrix.device }} | |
build: | |
needs: [format, docs] # Need tests once they are enabled again | |
strategy: | |
fail-fast: false | |
matrix: | |
rust-channel: [ 'stable', 'nightly' ] | |
rust-target: [ 'x86_64-unknown-linux-gnu', 'thumbv7em-none-eabihf' ] | |
device: ['xmc4100', 'xmc4200', 'xmc4300', 'xmc4400', 'xmc4500', 'xmc4700', 'xmc4800'] | |
name: Build-${{ matrix.rust-channel }}-${{ matrix.rust-target }}-${{ matrix.device }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Install toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust-channel }} | |
target: ${{ matrix.rust-target }} | |
- name: Cargo Check | |
run: cargo check --target ${{ matrix.rust-target }} --features=${{ matrix.device }} | |
- name: Cargo Build | |
run: cargo build --verbose --target ${{ matrix.rust-target }} --features=${{ matrix.device }} | |
examples: | |
needs: [build] | |
strategy: | |
matrix: | |
device: ['xmc4100', 'xmc4200', 'xmc4300', 'xmc4400', 'xmc4500', 'xmc4700', 'xmc4800'] | |
name: Examples-${{ matrix.device }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Setup toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: 'stable' | |
target: 'thumbv7em-none-eabihf' | |
- name: Build Examples | |
run: cargo build --examples --features=${{ matrix.device }} | |
release-please: | |
name: Execute release chores | |
needs: build | |
if: contains(github.ref, 'master') | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
outputs: | |
created: ${{ steps.release.outputs.release_created }} | |
steps: | |
- uses: google-github-actions/release-please-action@v4 | |
id: release | |
with: | |
release-type: rust | |
token: ${{ secrets.GH_PERSONAL_TOKEN }} | |
publish: | |
name: Publish to crates.io | |
runs-on: ubuntu-latest | |
needs: release-please | |
if: needs.release-please.outputs.created | |
environment: crates.io | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
target: thumbv7em-none-eabihf | |
- uses: swatinem/rust-cache@v2 | |
- name: Publish | |
# https://doc.rust-lang.org/cargo/reference/config.html?highlight=CARGO_REGISTRY_TOKEN#credentials | |
run: > | |
cargo publish | |
--verbose | |
--locked | |
--features xmc4200 | |
--token ${{ secrets.CRATES_TOKEN }} |