-
Notifications
You must be signed in to change notification settings - Fork 1
176 lines (167 loc) · 3.96 KB
/
build.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Build
on:
push:
branches:
- "main"
tags:
- "*"
pull_request:
jobs:
check_formatting:
name: "Check Formatting"
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
- run: cargo fmt --all -- --check
working-directory: common
- run: cargo fmt --all -- --check
working-directory: host
- run: cargo fmt --all -- --check
working-directory: tee
build:
strategy:
matrix:
profile:
- development
- release
- kasan
- profiling
name: "Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.profile }}
workspaces: |
common
host
tee
- name: "Build"
run: make
env:
PROFILE: ${{ matrix.profile }}
# Build the CLI with various feature configurations.
build-cli:
strategy:
matrix:
snp:
- true
- false
tdx:
- true
- false
insecure:
- true
- false
name: "Build CLI"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: build-cli-${{ matrix.snp }}-${{ matrix.tdx }}-${{ matrix.insecure }}
workspaces: |
host
- name: "Build"
run: make cli
env:
TEE_SNP: ${{ matrix.snp }}
TEE_TDX: ${{ matrix.tdx }}
TEE_INSECURE: ${{ matrix.insecure }}
build-cli-on-stable:
name: "Build CLI on stable"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: build-cli-stable
workspaces: |
host
- name: "Build"
run: cargo +stable build --all-features
working-directory: host/mushroom
clippy:
name: "Clippy"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: clippy
workspaces: |
common
host
tee
- name: "Check common"
run: cargo clippy --workspace -- -D warnings
working-directory: common
- name: "Check host"
run: cargo clippy --workspace -- -D warnings
working-directory: host
- name: "Check tee"
run: cargo clippy --workspace --exclude example -- -D warnings
working-directory: tee
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: test
workspaces: |
common
host
tee
- name: "Test"
run: cargo test -p tests
working-directory: tee
test:
strategy:
matrix:
profile:
- development
- release
- kasan
time_backend:
- fake
- real
test_target:
- amd64
- i386
tee:
- snp
- tdx
- insecure
exclude:
# KASAN isn't (yet) supported on TDX.
- profile: kasan
tee: tdx
name: "Test"
runs-on: ${{ matrix.tee != 'insecure' && matrix.tee || 'self-hosted' }}
steps:
- uses: actions/checkout@v4
- name: "Test"
run: make test
env:
PROFILE: ${{ matrix.profile }}
TIME_BACKEND: ${{ matrix.time_backend }}
TEST_TARGET: ${{ matrix.test_target }}
TEE: ${{ matrix.tee }}
integration-test:
strategy:
matrix:
tee:
- snp
- tdx
name: "Integration Test"
runs-on: ${{ matrix.tee }}
steps:
- uses: actions/checkout@v4
- name: "Build & Run Example Init Binary"
run: make run-example
env:
PROFILE: release
TEE: ${{ matrix.tee }}