-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
92 lines (83 loc) · 2.56 KB
/
action.yml
File metadata and controls
92 lines (83 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Functional Tests
description: "Run QEMU functional tests"
inputs:
qemu_bin:
description: "Path to the QEMU binary (relative to workspace root)"
required: false
default: "qemu-system-x86_64"
accel:
description: "Accelerator to use (kvm or mshv)"
required: false
default: "kvm"
test_filter:
description: "Test filter (e.g. 'kernel_boot', 'migration_os'). Empty runs default tests."
required: false
test_jobs:
description: "Number of parallel test jobs"
default: "2"
required: false
runs:
using: 'composite'
steps:
- name: Check dependencies
working-directory: ${{ github.action_path }}
shell: bash
env:
QEMU_BIN: ${{ inputs.qemu_bin }}
run: make check-tools
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
- name: Build cache params
shell: bash
working-directory: ${{ github.action_path }}
id: build-cache-params
run: |
cache_key="payloads-$(md5sum Makefile | cut -d' ' -f1)"
echo "key=$cache_key" >> $GITHUB_OUTPUT
{
echo "path<<EOF"
make echo-cachable-payloads
echo "EOF"
} >> $GITHUB_OUTPUT
- name: Cache runtime payloads
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae #v5.0.5
with:
path: ${{ steps.build-cache-params.outputs.path }}
key: ${{ steps.build-cache-params.outputs.key }}
- name: Build tests
shell: bash
working-directory: ${{ github.action_path }}
run: make build-release
- name: Run tests
shell: bash
working-directory: ${{ github.action_path }}
env:
ACCEL: ${{ inputs.accel }}
QEMU_BIN: ${{ inputs.qemu_bin }}
TEST_FILTER: ${{ inputs.test_filter }}
TEST_JOBS: ${{ inputs.test_jobs }}
RUST_LOG: warn
run: |
if [ -z "$TEST_FILTER" ]; then
unset TEST_FILTER
fi
sudo -E env "PATH=$PATH" make run-release
- name: Run os migration tests
working-directory: ${{ github.action_path }}
shell: bash
env:
ACCEL: ${{ inputs.accel }}
QEMU_BIN: ${{ inputs.qemu_bin }}
TEST_FILTER: ${{ inputs.test_filter }}
TEST_JOBS: ${{ inputs.test_jobs }}
RUST_LOG: warn
run: |
sudo make setup-bridge NUM_TAPS=$((TEST_JOBS * 2))
sudo -E env "PATH=$PATH" make run-release "TEST_FILTER=migration_os${TEST_FILTER:+,$TEST_FILTER}"
- name: Cleanup
if: always()
working-directory: ${{ github.action_path }}
shell: bash
env:
TEST_JOBS: ${{ inputs.test_jobs }}
run: sudo make teardown-bridge