Add TDX CI

This commit is contained in:
Hsy-Intel 2024-07-09 10:49:27 +08:00 committed by Tate, Hongliang Tian
parent b73412c2ff
commit 6ff6db2167
2 changed files with 61 additions and 1 deletions

View File

@ -5,9 +5,13 @@ on:
push:
branches:
- main
# Schedule to run on every day at 15:00 UTC (23:00 CST)
schedule:
- cron: '0 15 * * *'
jobs:
lint:
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 15
container: asterinas/asterinas:0.6.2
@ -21,6 +25,7 @@ jobs:
run: make check
unit-test:
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 15
container: asterinas/asterinas:0.6.2
@ -40,6 +45,7 @@ jobs:
# TODO: add component check.
integration-test:
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
container: asterinas/asterinas:0.6.2
@ -86,3 +92,57 @@ jobs:
- name: General Test (Linux EFI Handover Boot Protocol)
id: test_linux
run: make run AUTO_TEST=test ENABLE_KVM=0 BOOT_PROTOCOL=linux-efi-handover64 RELEASE=1
integration-test-tdx:
if: github.event_name == 'schedule'
runs-on: self-hosted
timeout-minutes: 30
container:
image: asterinas/asterinas:0.6.2-tdx
options: --device=/dev/kvm --privileged
env:
# Need to set up proxy since the self-hosted CI server is located in China,
# which has poor network connection to the official Rust crate repositories.
RUSTUP_DIST_SERVER: https://mirrors.ustc.edu.cn/rust-static
RUSTUP_UPDATE_ROOT: https://mirrors.ustc.edu.cn/rust-static/rustup
steps:
- run: echo "Running in asterinas/asterinas:0.6.2-tdx"
- uses: actions/checkout@v4
- name: Set up the environment
run: |
chmod +x test/benchmark/bench_linux_and_aster.sh
# Set up git due to the network issue on the self-hosted runner
git config --global --add safe.directory /__w/asterinas/asterinas
git config --global http.sslVerify false
git config --global http.version HTTP/1.1
- name: Boot Test (Linux EFI Handover Boot Protocol)
uses: nick-invision/retry@v2
id: boot_test_linux_efi_handover64
with:
timeout_minutes: 20
max_attempts: 3
command: make run AUTO_TEST=boot INTEL_TDX=1
- name: Syscall Test (Linux EFI Handover Boot Protocol)
uses: nick-invision/retry@v2
id: syscall_test
with:
timeout_minutes: 20
max_attempts: 3
command: make run AUTO_TEST=syscall INTEL_TDX=1
- name: Syscall Test at Exfat
uses: nick-invision/retry@v2
id: syscall_test_at_exfat_linux
with:
timeout_minutes: 20
max_attempts: 3
command: make run AUTO_TEST=syscall SYSCALL_TEST_DIR=/exfat EXTRA_BLOCKLISTS_DIRS=blocklists.exfat INTEL_TDX=1
- name: General Test (Linux EFI Handover Boot Protocol)
uses: nick-invision/retry@v2
id: test_linux
with:
timeout_minutes: 20
max_attempts: 3
command: make run AUTO_TEST=test INTEL_TDX=1

View File

@ -66,7 +66,7 @@ git clone https://github.com/asterinas/asterinas
2. Run a Docker container as the development environment.
```bash
docker run -it --privileged --network=host --device=/dev/kvm -v $(pwd)/asterinas:/root/asterinas asterinas/asterinas:0.6.2_tdx
docker run -it --privileged --network=host --device=/dev/kvm -v $(pwd)/asterinas:/root/asterinas asterinas/asterinas:0.6.2-tdx
```
3. Inside the container,