tpm2-store/.github/workflows/ci.yml
Peter Robinson 62a4685aef chore: add clang-devel for ci build
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2023-07-28 10:54:31 +01:00

63 lines
1.8 KiB
YAML

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