diff --git a/.github/workflows/trustee-attester.yml b/.github/workflows/trustee-attester.yml new file mode 100644 index 000000000..a16e042ee --- /dev/null +++ b/.github/workflows/trustee-attester.yml @@ -0,0 +1,93 @@ +name: trustee-attester basic build + +on: + pull_request: + paths: + - 'attestation-agent/**' + - '.github/workflows/trustee-attester.yml' + - 'Cargo.toml' + - 'Cargo.lock' + create: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + trustee_attester_ci: + name: Check + defaults: + run: + working-directory: ./attestation-agent/kbs_protocol/ + strategy: + fail-fast: false + matrix: + rust: + - stable + instance: + - ubuntu-24.04 + - s390x + include: + - instance: ubuntu-24.04 + cargo_test_opts: "-p kbs_protocol --bin trustee-attester --no-default-features --features background_check,passport,openssl,all-attesters,bin" + - instance: s390x + cargo_test_opts: "-p kbs_protocol --bin trustee-attester --no-default-features --features background_check,passport,openssl,se-attester,bin" + runs-on: ${{ matrix.instance }} + steps: + - name: Code checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Install Rust toolchain (${{ matrix.rust }}) + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt, clippy + + - name: Install protoc + run: | + sudo apt-get update && sudo apt-get install -y protobuf-compiler + + - uses: ./.github/actions/install-intel-dcap + with: + ubuntu-version: noble + if: matrix.instance == 'ubuntu-24.04' + + - name: Install TPM dependencies + run: | + sudo apt-get update + sudo apt-get install -y libtss2-dev + if: matrix.instance == 'ubuntu-24.04' + + - name: Install dm-verity dependencies + run: | + sudo apt-get update + sudo apt-get install -y libdevmapper-dev + + - name: Run cargo build + uses: actions-rs/cargo@v1 + with: + command: build + args: ${{ matrix.cargo_test_opts }} + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: ${{ matrix.cargo_test_opts }} + + - name: Run cargo fmt check + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + - name: Run rust clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: ${{ matrix.cargo_test_opts }}