build(deps): bump zerocopy from 0.3.0 to 0.3.2 #311
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
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md | |
on: | |
pull_request: {} | |
push: | |
branches: develop | |
name: Rust | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
- name: Cache cargo registry | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Run cargo check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --workspace --exclude armistice_usbarmory | |
core: | |
name: Build core | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- armv7a-none-eabi | |
- thumbv7em-none-eabi | |
- wasm32-unknown-unknown | |
toolchain: | |
- 1.43.0 # MSRV | |
- stable | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
- name: Cache cargo registry | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v1 | |
with: | |
path: target | |
key: ${{ runner.os }}-rust-${{ matrix.toolchain }}-${{ matrix.target }}-cargo-build-target-${{ hashFiles('Cargo.lock') }} | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
target: ${{ matrix.target }} | |
toolchain: ${{ matrix.toolchain }} | |
override: true | |
- name: Run cargo build | |
working-directory: core | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: -D warnings | |
run: cargo build --release --target ${{ matrix.target }} | |
usbarmory: | |
name: Build usbarmory | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
- name: Cache cargo registry | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-usbarmory-cargo-index-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v1 | |
with: | |
path: target | |
key: ${{ runner.os }}-usbarmory-cargo-build-target-${{ hashFiles('Cargo.lock') }} | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
target: armv7a-none-eabi | |
toolchain: stable | |
override: true | |
- name: Install flip-lld | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: --git https://github.com/japaric/flip-lld --rev b1028b9 | |
- name: Run cargo build | |
working-directory: usbarmory | |
env: | |
CARGO_INCREMENTAL: 0 | |
run: cargo build --release | |
test: | |
name: Test Suite | |
strategy: | |
matrix: | |
platform: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
toolchain: | |
- 1.43.0 # MSRV | |
- stable | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
- name: Cache cargo registry | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v1 | |
with: | |
path: target | |
key: ${{ runner.os }}-rust-${{ matrix.toolchain }}-cargo-build-target-${{ hashFiles('Cargo.lock') }} | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
override: true | |
- name: Run cargo test --no-default-features (core) | |
working-directory: core | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: -D warnings | |
run: cargo test --no-default-features --release | |
- name: Run cargo test | |
uses: actions-rs/cargo@v1 | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: -D warnings | |
with: | |
command: test | |
args: --release --workspace --exclude armistice_usbarmory | |
- name: Run cargo test (--all-features) | |
uses: actions-rs/cargo@v1 | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: -D warnings | |
with: | |
command: test | |
args: --all-features --release --workspace --exclude armistice_usbarmory | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Cache cargo registry | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo build | |
uses: actions/cache@v1 | |
with: | |
path: target | |
key: ${{ runner.os }}-coverage-cargo-build-target-${{ hashFiles('Cargo.lock') }} | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Run cargo-tarpaulin | |
uses: actions-rs/[email protected] | |
env: | |
CARGO_INCREMENTAL: 0 | |
with: | |
version: 0.11.0 | |
args: --all --exclude armistice_usbarmory -- --test-threads 1 | |
- name: Upload to codecov.io | |
uses: codecov/[email protected] | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v1 | |
with: | |
name: code-coverage-report | |
path: cobertura.xml | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install rustfmt | |
run: rustup component add rustfmt | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
- name: Cache cargo registry | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | |
- name: Cache cargo index | |
uses: actions/cache@v1 | |
with: | |
path: ~/.cargo/git | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install clippy | |
run: rustup component add clippy | |
- name: Run cargo clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --workspace --exclude armistice_usbarmory -- -D warnings |