@@ -5,52 +5,55 @@ name: Continuous integration
55jobs :
66 check :
77 name : Check
8- runs-on : ubuntu-latest
9- container :
10- image : ghcr.io/cosmian/intel-sgx:2.25
8+ runs-on : ubuntu-24.04
119 steps :
10+ - name : Checkout
11+ uses : actions/checkout@v4
12+
13+ - name : Cache dependencies
14+ id : cargo-cache
15+ uses : Swatinem/rust-cache@v2
16+ with :
17+ key : ${{ github.ref_name }}
18+
1219 - name : Install dependencies
20+ if : steps.cargo-cache.outputs.cache-hit != 'true'
1321 run : |
14- apt-get update && apt-get install -y libssl-dev tpm2-tools libtss2-dev libtdx-attest-dev
22+ sudo curl -fsSLo /usr/share/keyrings/intel-sgx-deb.asc https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key
23+ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx-deb.asc] https://download.01.org/intel-sgx/sgx_repo/ubuntu noble main" | sudo tee /etc/apt/sources.list.d/intel-sgx.list
24+ sudo apt-get update && sudo apt-get install -y tpm2-tools libtss2-dev libtdx-attest=1.24.100.2-noble1 libtdx-attest-dev=1.24.100.2-noble1
1525
16- - uses : actions/checkout@v2
17-
18- - name : Rustup setup
19- uses : actions-rs/toolchain@v1
26+ - name : Install Rust toolchain and components
27+ if : steps.cargo-cache.outputs.cache-hit != 'true'
28+ uses : dtolnay/rust-toolchain@stable
2029 with :
21- profile : minimal
2230 toolchain : stable
23- override : true
24-
25- - run : rustup component add rustfmt && rustup component add clippy && cargo install cargo-machete
31+ components : rustfmt, clippy
2632
27- - name : Security Audit
28- uses : EmbarkStudios/cargo-deny-action@v2
33+ - name : Install cargo-machete
34+ if : steps.cargo-cache.outputs.cache-hit != 'true'
35+ run : cargo install cargo-machete
2936
3037 - name : Cargo fmt
31- uses : actions-rs/cargo@v1
32- with :
33- command : fmt
34- args : --all -- --check
38+ if : steps.cargo-cache.outputs.cache-hit != 'true'
39+ run : cargo fmt --all -- --check
3540
3641 - name : Cargo check
37- uses : actions-rs/cargo@v1
38- with :
39- command : check
42+ if : steps.cargo-cache.outputs.cache-hit != 'true'
43+ run : cargo check
4044
4145 - name : Clippy
42- uses : actions-rs/cargo@v1
43- with :
44- command : clippy
45- args : -- -D warnings
46+ if : steps.cargo-cache.outputs.cache-hit != 'true'
47+ run : cargo clippy -- -D warnings
4648
4749 - name : Machete (deps checker)
48- uses : actions-rs/cargo@v1
49- with :
50- command : machete
50+ if : steps.cargo-cache.outputs.cache-hit != 'true'
51+ run : cargo machete
5152
5253 - name : Cargo test
53- uses : actions-rs/cargo@v1
54- with :
55- command : test
56- args : -- --nocapture
54+ if : steps.cargo-cache.outputs.cache-hit != 'true'
55+ run : cargo test -- --nocapture
56+
57+ - name : Cargo build
58+ if : steps.cargo-cache.outputs.cache-hit != 'true'
59+ run : cargo build --release
0 commit comments