Merge pull request #22 from nullr0ute/release-0.5.3 #39
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: Continuous Integration | |
on: [push, pull_request] | |
jobs: | |
formatting: | |
name: Check formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
tests: | |
name: Perform tests | |
runs-on: ubuntu-latest | |
container: fedora:latest | |
defaults: | |
run: | |
working-directory: ./clevis-pin-tpm2 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: clevis-pin-tpm2 | |
- name: Check out the policy signtool | |
uses: actions/checkout@v2 | |
with: | |
path: clevis-pin-tpm2-signtool | |
repository: puiterwijk/clevis-pin-tpm2-signtool | |
- name: Install dependencies | |
run: | | |
dnf install -y \ | |
tpm2-tss-devel clevis \ | |
swtpm swtpm-tools \ | |
rust cargo clippy \ | |
golang clang-devel | |
- name: Remove clevis-pin-tpm2 | |
run: | | |
dnf erase -y clevis-pin-tpm2 | |
- name: Build | |
run: cargo build | |
- name: Start swtpm | |
run: | | |
mkdir /tmp/tpmdir | |
swtpm_setup --tpm2 \ | |
--tpmstate /tmp/tpmdir \ | |
--createek --decryption --create-ek-cert \ | |
--create-platform-cert \ | |
--pcr-banks sha1,sha256 \ | |
--display | |
swtpm socket --tpm2 \ | |
--tpmstate dir=/tmp/tpmdir \ | |
--flags startup-clear \ | |
--ctrl type=tcp,port=2322 \ | |
--server type=tcp,port=2321 \ | |
--daemon | |
- name: Run integration tests | |
run: | | |
TCTI=swtpm: SKIP_CLEVIS=true cargo test -- --nocapture | |
- name: Run policy tests | |
run: | | |
TCTI=swtpm: ./tests/test_policy | |
- name: Run clippy | |
run: cargo clippy -- -D warnings |