docs(README.md): Remove eh1 warnings #35
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: Cargo Build & Test | |
on: | |
push: | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_and_test: | |
name: Rust project - latest | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- nightly | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Cache cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v3 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-target-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo bin | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/bin | |
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }} | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-all-features | |
- name: Build | |
run: cargo build-all-features --verbose | |
- name: Run tests | |
run: cargo test-all-features | |
- name: Run `cargo-deny` | |
uses: EmbarkStudios/cargo-deny-action@v1 | |
- name: Check feature gate | |
working-directory: ./.github/workflows/ci | |
run: rustc main.rs --verbose --forbid warnings | |
test_semver: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check semver | |
uses: obi1kenobi/cargo-semver-checks-action@v2 | |
build_examples: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly-2023-08-08 | |
components: rust-src, cargo, rust-std, rustc | |
- name: Install `avr-gcc` tools | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: gcc-avr avr-libc | |
version: 1.0 | |
- name: Cache cargo registry | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v3 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-target-nightly-${{ hashFiles('**/Cargo.lock') }} | |
# TODO: uncomment when arudino updates their HAL | |
#- name: Check Arduino MEGA 2560 example | |
# working-directory: ./examples/mega2560 | |
# run: cargo build --release --target avr-specs/avr-atmega2560.json | |
- name: Check `linux-eh` example | |
working-directory: ./examples/linux | |
run: cargo build --release |