Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e-test: fix binary build on self-hosted runners #438

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading