Skip to content

refactor(vm): separate argument parsing and device creation #1050

refactor(vm): separate argument parsing and device creation

refactor(vm): separate argument parsing and device creation #1050

Workflow file for this run

name: Rust
permissions: read-all
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build_test:
strategy:
matrix:
target:
- name: x86_64-unknown-linux-gnu
os: ubuntu-latest
- name: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
- name: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.cargo/bin/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.rustup/settings.toml
~/.rustup/toolchains/
~/.rustup/update-hashes/
target/
target/tarpaulin/
key: ${{ matrix.target.name }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install nightly Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt,llvm-tools
- name: Install stable Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Install tools
uses: taiki-e/install-action@3575e532701a5fc614b0c842e4119af4cc5fd16d # v2.62.60
with:
tool: cargo-llvm-cov,cargo-deny
- name: Check dependencies
run: cargo deny check
- name: Build
run: cargo build --verbose
- name: Format
run: cargo +nightly fmt --check
if: matrix.target.name == 'x86_64-unknown-linux-gnu'
- name: Run tests and collect coverage
env:
RUST_LOG: "trace"
run: |
cargo +nightly llvm-cov clean --workspace
cargo +nightly llvm-cov --branch \
--no-clean --workspace --ignore-filename-regex '.*_test.rs$' \
--lcov --output-path lcov-${{ matrix.target.name }}.info
- name: Clippy
run: cargo clippy -- -D warnings
- name: Upload coverage report artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: lcov-${{ matrix.target.name }}.info
path: lcov-${{ matrix.target.name }}.info
upload_coverage:
needs: build_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Download coverage reports
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
path: lcov
pattern: lcov-*.info
merge-multiple: true
- name: Merge coverage reports
run: |
sed -i 's#SF:/Users/#SF:/home/#g' lcov/*apple-darwin*.info
npx lcov-result-merger 'lcov/lcov-*.info' lcov.info
- name: Upload coverage
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
continue-on-error: true