-
Notifications
You must be signed in to change notification settings - Fork 20
83 lines (76 loc) · 2.33 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
RUSTFLAGS: -Dwarnings
jobs:
test:
name: Test on rust ${{matrix.rust}} (keys ${{ matrix.key_feature_set }})
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.68.2, stable, nightly]
key_feature_set:
- key_openssl_pkey
- key_kms
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- run: |
cargo test --all --no-default-features --features ${{ matrix.key_feature_set }} \
-- --skip sign::tests::kms # Requires AWS creds, skip them
test_fedora:
name: Test on Fedora
runs-on: ubuntu-latest
container: fedora:latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
dnf install -y \
tpm2-tss-devel \
swtpm swtpm-tools \
rust cargo clippy
- name: Start swtpm
run: |
mkdir /tmp/tpmdir
swtpm_setup --tpm2 \
--tpmstate /tmp/tpmdir \
--createek --decryption --create-ek-cert \
--create-platform-cert \
--display
swtpm socket --tpm2 \
--tpmstate dir=/tmp/tpmdir \
--flags startup-clear \
--ctrl type=tcp,port=2322 \
--server type=tcp,port=2321 \
--daemon
- name: Run tests
run: |
TCTI=swtpm: cargo test --features key_tpm,key_openssl_pkey
- name: Run clippy
run: |
cargo clippy --features key_tpm,key_openssl_pkey --all
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: rustup component add clippy
- run: cargo clippy --all
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check