Skip to content

Commit e5dcf48

Browse files
authored
Merge pull request #47 from Cosmian/bump-and-fix
Fix RUSTSEC with some major changes
2 parents c93bd1b + 09b636c commit e5dcf48

57 files changed

Lines changed: 2552 additions & 1889 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/Dockerfile

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,44 @@
1-
FROM ghcr.io/cosmian/intel-sgx:2.25
1+
FROM ubuntu:24.04
22

3-
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
4-
5-
ENV PATH="/root/.cargo/bin:${PATH}"
6-
7-
RUN rustup default stable
8-
9-
RUN rustup component add clippy rustfmt
3+
USER root
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
ENV TS=Etc/UTC
6+
ENV LANG=C.UTF-8
7+
ENV LC_ALL=C.UTF-8
108

119
RUN apt-get update && apt-get install --no-install-recommends -qq -y \
1210
build-essential \
11+
clang \
12+
curl \
13+
git \
14+
gnupg \
15+
tzdata\
1316
pkg-config \
1417
libssl-dev \
1518
python3 \
1619
python3-pip \
1720
tpm2-tools \
1821
libtss2-dev \
19-
libtdx-attest-dev \
2022
&& apt-get -y -q upgrade \
2123
&& apt-get clean \
22-
&& rm -rf /var/lib/apt/lists/* \
23-
&& python3 -m pip install "maturin"
24+
&& rm -rf /var/lib/apt/lists/*
2425

25-
RUN sed -i 's,https://localhost:8081/sgx/certification/v4/,https://pccs.staging.mse.cosmian.com/sgx/certification/v4/,' /etc/sgx_default_qcnl.conf
26+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
27+
28+
ENV PATH="/root/.cargo/bin:${PATH}"
29+
30+
RUN rustup default stable
31+
32+
RUN rustup component add clippy rustfmt
33+
34+
RUN cargo install --locked cargo-deny
35+
36+
# Intel SGX APT repository
37+
RUN curl -fsSLo /usr/share/keyrings/intel-sgx-deb.asc https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key && \
38+
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx-deb.asc] https://download.01.org/intel-sgx/sgx_repo/ubuntu noble main" \
39+
| tee /etc/apt/sources.list.d/intel-sgx.list
40+
41+
RUN apt-get update && apt-get install --no-install-recommends -qq -y libtdx-attest-dev \
42+
&& apt-get -y -q upgrade \
43+
&& apt-get clean \
44+
&& rm -rf /var/lib/apt/lists/*

.github/workflows/ci.yml

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,55 @@ name: Continuous integration
55
jobs:
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

Comments
 (0)