Skip to content

Commit

Permalink
Merge pull request #438 from mkulke/mkulke/fix-kbs-e2e-test-binaries-…
Browse files Browse the repository at this point in the history
…build

e2e-test: fix binary build on self-hosted runners
  • Loading branch information
mkulke authored Jul 5, 2024
2 parents 4922337 + 0d47ada commit a4d89fc
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 16 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/kbs-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ defaults:
shell: bash

jobs:
e2e-test:
runs-on: ${{ fromJSON(inputs.runs-on) }}
build-binaries:
runs-on: ubuntu-22.04
env:
RUSTC_VERSION: 1.76.0
steps:
- uses: actions/download-artifact@v4
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Extract tarball
run: tar xzf ./artifact/${{ inputs.tarball }}
Expand All @@ -47,6 +48,30 @@ jobs:
target/
key: rust-${{ hashFiles('./Cargo.lock') }}

- name: Build bins
working-directory: kbs/test
run: |
make install-dev-dependencies
make bins
- name: Archive test folder
run: tar czf test.tar.gz kbs/test

- uses: actions/upload-artifact@v4
with:
path: test.tar.gz
overwrite: true

e2e-test:
needs: build-binaries
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Extract test folder
run: tar xzf ./artifact/test.tar.gz

- name: Set up SGX/TDX certificates cache
uses: actions/cache@v4
with:
Expand All @@ -60,10 +85,6 @@ jobs:
sudo apt-get install -y make --no-install-recommends
sudo make install-dependencies
- name: Build bins
working-directory: kbs/test
run: make bins

- name: Set cc_kbc sample attester env
if: inputs.tee == 'sample'
run: echo "AA_SAMPLE_ATTESTER_TEST=1" >> "$GITHUB_ENV"
Expand Down
25 changes: 16 additions & 9 deletions kbs/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,33 @@ allow {
endef
export TEE_POLICY_REGO

.PHONY: install-dev-dependencies
install-dev-dependencies: install-dependencies
sudo apt-get update && \
sudo apt-get install -y \
build-essential \
clang \
libsgx-dcap-quote-verify-dev \
libssl-dev \
libtdx-attest-dev \
libtss2-dev \
pkg-config \
protobuf-compiler

.PHONY: install-dependencies
install-dependencies:
curl -L "$(SGX_REPO_URL)/intel-sgx-deb.key" | sudo apt-key add - && \
echo "deb [arch=amd64] $(SGX_REPO_URL) jammy main" \
| sudo tee /etc/apt/sources.list.d/intel-sgx.list && \
sudo apt-get update && \
sudo apt-get install -y \
build-essential \
clang \
libsgx-dcap-default-qpl \
libsgx-dcap-quote-verify \
libsgx-dcap-quote-verify-dev \
libsgx-urts \
libssl-dev \
libtdx-attest \
libtdx-attest-dev \
libtss2-dev \
openssl \
pkg-config \
protobuf-compiler && \
libtss2-esys-3.0.2-0 \
libtss2-tctildr0 \
openssl && \
echo '{"collateral_service": "$(SGX_COLLATERAL_URL)"}' | sudo tee $(SGX_QCNL_CONFIG)

kbs:
Expand Down

0 comments on commit a4d89fc

Please sign in to comment.