Skip to content

github/qemu: run dmesg #132

github/qemu: run dmesg

github/qemu: run dmesg #132

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
checkout:
name: Checkout
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
- name: Upload source
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: source-code
path: .
retention-days: 1
# Make sure .cargo/ is uploaded as well
include-hidden-files: true
check:
name: Format / Clippy / Documentation
runs-on: ubuntu-latest
needs: checkout
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: source-code
- name: Install rust toolchain
run: rustup toolchain install --profile minimal
- name: Add clippy
run: rustup component add clippy rustfmt
- name: Install TPM 2.0 Reference Implementation build dependencies
run: sudo apt install -y build-essential cmake pkg-config
# release/src/git_version.rs is auto-generated via a build.rs file. Touch
# it here to avoid CI failures.
- name: Touch release/src/git_version.rs
run: echo "" > release/src/git_version.rs
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: make clippy
- name: Documentation
run: make doc
env:
RUSTDOCFLAGS: -D warnings
- name: Check that Cargo.lock is up to date
run: cargo update --workspace --locked
build-test-debug:
name: Build & test (debug)
runs-on: ubuntu-latest
needs: checkout
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: source-code
- name: Install rust toolchain
run: rustup toolchain install --profile minimal
- name: Install TPM 2.0 Reference Implementation build dependencies
run: sudo apt install -y build-essential cmake pkg-config
- name: Build (non-test) debug images
run: cargo xbuild ./configs/*.json
- name: Build (non-test) debug images with all features
run: cargo xbuild --all-features ./configs/*.json
- name: Run tests
run: make test
build-test-release:
name: Build & test (release)
runs-on: ubuntu-latest
needs: checkout
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: source-code
- name: Install rust toolchain
run: rustup toolchain install --profile minimal
- name: Install TPM 2.0 Reference Implementation build dependencies
run: sudo apt install -y build-essential cmake pkg-config
- name: Build (non-test) release images
run: cargo xbuild --release ./configs/*.json
- name: Run tests on release image
run: make test RELEASE=1
nightly-check:
runs-on: ubuntu-latest
needs: checkout
continue-on-error: true
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: source-code
- name: Install latest nightly
run: rustup toolchain install nightly -t x86_64-unknown-none --profile minimal --force -c rustfmt
# release/src/git_version.rs is auto-generated via a build.rs file. Touch
# it here to avoid CI failures.
- name: Touch release/src/git_version.rs
run: echo "" > release/src/git_version.rs
- name: Format doctests
run: cargo +nightly fmt --all -- --check --config "format_code_in_doc_comments=true"