Skip to content

Commit 42960dc

Browse files
committed
Add CI workflow for isolated AMDSEV initrd tests
1 parent 27ecf35 commit 42960dc

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: amdsev-initrd-test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "misc/AMDSEV/**"
9+
- "scripts/build-musl.sh"
10+
- ".github/workflows/amdsev-initrd-test.yml"
11+
12+
pull_request:
13+
types: [opened, synchronize, ready_for_review]
14+
paths:
15+
- "misc/AMDSEV/**"
16+
- "scripts/build-musl.sh"
17+
- ".github/workflows/amdsev-initrd-test.yml"
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
23+
env:
24+
CARGO_TERM_COLOR: always
25+
26+
jobs:
27+
amdsev-initrd-test:
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 90
30+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false)
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
with:
35+
submodules: recursive
36+
37+
- name: Install dependencies
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y \
41+
qemu-system-x86 \
42+
cpio \
43+
zstd \
44+
e2fsprogs \
45+
curl \
46+
musl-tools \
47+
clang
48+
49+
- uses: Swatinem/rust-cache@v2
50+
with:
51+
key: ci-${{ github.job }}
52+
shared-key: katana-ci-cache-musl
53+
54+
- name: Build required VM components
55+
run: |
56+
set -euo pipefail
57+
source misc/AMDSEV/build-config
58+
export SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)"
59+
60+
./scripts/build-musl.sh
61+
KATANA_BINARY="./target/x86_64-unknown-linux-musl/performance/katana"
62+
63+
./misc/AMDSEV/build-kernel.sh ./misc/AMDSEV/output/qemu
64+
./misc/AMDSEV/build-initrd.sh "$KATANA_BINARY" ./misc/AMDSEV/output/qemu/initrd.img "$KERNEL_VERSION"
65+
66+
cp "$KATANA_BINARY" ./misc/AMDSEV/output/qemu/katana
67+
68+
- name: Run isolated initrd tests
69+
run: |
70+
./misc/AMDSEV/test-initrd.sh --output-dir ./misc/AMDSEV/output/qemu --timeout 300
71+
72+
- name: Upload AMDSEV build output on failure
73+
if: failure()
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: amdsev-initrd-output-${{ github.run_id }}
77+
if-no-files-found: ignore
78+
path: |
79+
misc/AMDSEV/output/qemu

0 commit comments

Comments
 (0)