Skip to content

Commit d19adcd

Browse files
committed
CI: add sdk installation script
Signed-off-by: Jun Kimura <jun.kimura@datachain.jp>
1 parent 362b571 commit d19adcd

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

.github/scripts/install_sgx_sdk.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
set -eox pipefail
3+
4+
if [ $# -eq 0 ]; then
5+
echo "No arguments supplied"
6+
exit 1
7+
fi
8+
SDK_DIR_PREFIX=$1
9+
10+
DCAP_VERSION=1.21.100.3-jammy1
11+
# create tmp dir
12+
TMP_DIR=$(mktemp -d)
13+
echo "Created temp dir: $TMP_DIR"
14+
cd $TMP_DIR
15+
# clone the repo
16+
git clone --recursive https://github.com/intel/SGXDataCenterAttestationPrimitives -b dcap_1.21_reproducible --depth 1
17+
18+
wget https://download.01.org/intel-sgx/sgx-dcap/1.21/linux/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.24.100.3.bin -O sgx_linux_x64_sdk.bin
19+
chmod a+x sgx_linux_x64_sdk.bin
20+
./sgx_linux_x64_sdk.bin --prefix=$SDK_DIR_PREFIX
21+
rm -rf ./sgx_linux_x64_sdk.bin
22+
23+
wget https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key
24+
cat intel-sgx-deb.key | tee /etc/apt/keyrings/intel-sgx-keyring.asc > /dev/null
25+
echo 'deb [signed-by=/etc/apt/keyrings/intel-sgx-keyring.asc arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | tee /etc/apt/sources.list.d/intel-sgx.list
26+
27+
apt-get update -y
28+
apt-get install -y libsgx-dcap-ql=$DCAP_VERSION libsgx-dcap-ql-dev=$DCAP_VERSION

.github/workflows/test.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ jobs:
4646
./enclave
4747
cache-directories: |
4848
~/.cargo/registry/src/**/librocksdb-sys-*
49-
- run: curl -LO https://download.01.org/intel-sgx/sgx-linux/2.19/distro/ubuntu22.04-server/sgx_linux_x64_sdk_2.19.100.3.bin
50-
- run: chmod +x ./sgx_linux_x64_sdk_2.19.100.3.bin
51-
- run: echo -e 'no\n/opt' | ./sgx_linux_x64_sdk_2.19.100.3.bin
52-
- run: source /opt/sgxsdk/environment && make -B
53-
- run: source /opt/sgxsdk/environment && make test
54-
- run: source /opt/sgxsdk/environment && make integration-test
49+
- run: sudo bash .github/scripts/install_sgx_sdk.sh /opt/intel
50+
- run: source /opt/intel/sgxsdk/environment && make -B
51+
- run: source /opt/intel/sgxsdk/environment && make test
52+
- run: source /opt/intel/sgxsdk/environment && make integration-test

0 commit comments

Comments
 (0)