Inherit the upstream CI tests #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: KBS e2e | ||
on: | ||
workflow_call: | ||
inputs: | ||
tee: | ||
type: string | ||
required: true | ||
runs-on: | ||
type: string | ||
default: '["ubuntu-24.04"]' | ||
description: JSON representation of runner labels | ||
tarball: | ||
type: string | ||
description: Artifact containing checked out source from a prior job | ||
required: true | ||
# Self-hosted runners do not set -o pipefail otherwise | ||
defaults: | ||
run: | ||
shell: bash | ||
jobs: | ||
build-binaries: | ||
runs-on: ubuntu-24.04 | ||
env: | ||
RUSTC_VERSION: 1.84.1 | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
- name: Extract tarball | ||
run: tar xzf ./artifact/${{ inputs.tarball }} | ||
- name: Install Rust toolchain (${{ env.RUSTC_VERSION }}) | ||
run: | | ||
rustup update --no-self-update ${{ env.RUSTC_VERSION }} | ||
rustup component add --toolchain ${{ env.RUSTC_VERSION }} rustc | ||
rustup default ${{ env.RUSTC_VERSION }} | ||
- name: Install Python 3.12 and development libraries | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y python3.12 python3.12-dev libudev-dev | ||
- name: Set up rust build cache | ||
uses: actions/cache@v4 | ||
continue-on-error: false | ||
with: | ||
path: | | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
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: | ||
path: /root/.dcap-qcnl | ||
key: ${{ runner.os }}-dcap-qcnl | ||
- name: Install dependencies | ||
working-directory: kbs/test | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y make --no-install-recommends | ||
sudo make install-dependencies | ||
- name: Set cc_kbc sample attester env | ||
if: inputs.tee == 'sample' | ||
run: echo "AA_SAMPLE_ATTESTER_TEST=1" >> "$GITHUB_ENV" | ||
- name: Run e2e test | ||
working-directory: kbs/test | ||
env: | ||
TEE: ${{ inputs.tee }} | ||
RUST_LOG: warn | ||
run: sudo -E make e2e-test |