Tcgtpm v184 cmake #74
This file contains hidden or 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: Rust | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Install rust toolchain | |
| run: rustup toolchain install --profile minimal | |
| - name: Add rust components | |
| run: rustup component add rustfmt rust-src clippy | |
| - name: Check that Cargo.lock is up to date. | |
| run: cargo update --workspace --locked | |
| - name: Install TPM 2.0 Reference Implementation build dependencies | |
| run: sudo apt install -y build-essential cmake pkg-config | |
| - name: Build debug image | |
| run: cargo xbuild ./configs/* | |
| - name: Build debug image with all features | |
| run: cargo xbuild --all-features ./configs/* | |
| - name: Build release image | |
| run: cargo xbuild --release ./configs/* | |
| - name: Run tests | |
| run: make test | |
| - name: Run tests on release image | |
| run: make test RELEASE=1 | |
| - name: Format | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: make clippy | |
| - name: Check documentation | |
| run: make doc | |
| env: | |
| RUSTDOCFLAGS: -D warnings | |
| nightly-check: | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - 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" |