diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f68eb6e35..eeef21aea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,6 +115,31 @@ jobs: - 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 + EDMM: 0 + 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/cargo-binstall@v1.6.4 + - name: Install sgx + run: make install + - name: Build sgx prover + run: make build + - name: Test sgx prover + run: make test + build-test-sgx-with-docker: name: Build and test sgx with Docker runs-on: ubuntu-latest diff --git a/script/install.sh b/script/install.sh index a60b55b56..b11707bf5 100755 --- a/script/install.sh +++ b/script/install.sh @@ -32,9 +32,15 @@ fi # SGX if [ -z "$1" ] || [ "$1" == "sgx" ]; then - # For SGX, install gramine: https://github.com/gramineproject/gramine. - wget -O /tmp/gramine.deb https://packages.gramineproject.io/pool/main/g/gramine/gramine_1.6.2_amd64.deb - sudo apt install /tmp/gramine.deb + # also check if sgx is already installed + if command -v gramine-sgx >/dev/null 2>&1; then + echo "gramine already installed" + else + echo "gramine not installed, installing..." + # For SGX, install gramine: https://github.com/gramineproject/gramine. + wget -O /tmp/gramine.deb https://packages.gramineproject.io/pool/main/g/gramine/gramine_1.6.2_amd64.deb + sudo apt install -y /tmp/gramine.deb + fi fi # RISC0 if [ -z "$1" ] || [ "$1" == "risc0" ]; then