-
Notifications
You must be signed in to change notification settings - Fork 91
193 lines (181 loc) · 4.83 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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: CI
on:
push:
branches: ["main"]
pull_request:
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-test:
name: Build and test native
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: native
CI: 1
MOCK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-04-17
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install native
run: make install
- name: Build native prover
run: make build
- name: Test native prover
run: make test
build-test-risc0:
name: Build and test risc0
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: risc0
CI: 1
MOCK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- uses: risc0/risc0/.github/actions/[email protected]
- name: Install risc0
run: make install
- name: Build risc0 prover
run: make build
- name: Test risc0 prover
run: make test
build-test-sp1:
name: Build and test sp1
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: sp1
CI: 1
MOCK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-04-17
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install sp1
run: make install
- name: Build sp1 prover
run: make build
- name: Test sp1 prover
run: make test
build-test-sgx:
name: Build and test sgx
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TARGET: sgx
CI: 1
MOCK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install sgx
run: make install
- name: Build sgx prover
run: make build
- name: Test sgx prover
run: make test
build-test-sgx-hardware:
name: Build and test sgx in hardware
runs-on: [self-hosted, sgx, linux]
timeout-minutes: 120
env:
TARGET: sgx
CI: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: Install sgx
run: TARGET="sgx" CI=1 make install
- name: Build sgx prover
run: TARGET="sgx" make build
- name: prevalidate sgx hw execution env
run: |
cd target/release
gramine-manifest -Dlog_level=error -Ddirect_mode=0 -Darch_libdir=/lib/x86_64-linux-gnu/ ../../provers/sgx/config/sgx-guest.local.manifest.template sgx-guest.manifest
gramine-sgx-sign --manifest sgx-guest.manifest --output sgx-guest.manifest.sgx
gramine-sgx-sigstruct-view sgx-guest.sig
cd -
- name: Test sgx prover
run: make test
build-test-sgx-with-docker:
name: Build and test sgx with Docker
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Setup and build
run: |
cd docker
docker compose build --no-cache
shell: bash
test-lib:
name: Test raiko-lib
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
- run: cargo test -p raiko-lib --features=std
clippy:
name: clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: risc0/risc0/.github/actions/[email protected]
- uses: risc0/risc0/.github/actions/[email protected]
- uses: risc0/clippy-action@main
with:
reporter: 'github-pr-check'
fail_on_error: true
clippy_flags: --workspace --all-targets --all-features -- -Dwarnings
fmt:
name: fmt
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: risc0/risc0/.github/actions/[email protected]
- run: make fmt