-
Notifications
You must be signed in to change notification settings - Fork 165
131 lines (110 loc) · 3.89 KB
/
dep_build_test.yml
File metadata and controls
131 lines (110 loc) · 3.89 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build and Test
on:
workflow_call:
inputs:
docs_only:
description: Skip building if docs only
required: false
type: string
default: "false"
hypervisor:
description: Hypervisor for this run (passed from caller matrix)
required: true
type: string
config:
description: Build configuration for this run (passed from caller matrix)
required: true
type: string
cpu:
description: CPU architecture for the build (passed from caller matrix)
required: true
type: string
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
build-and-test:
if: ${{ inputs.docs_only == 'false' }}
timeout-minutes: 45
runs-on: ${{ fromJson(
format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}", "JobId=build-and-test-{3}-{4}-{5}-{6}"]',
inputs.hypervisor == 'hyperv-ws2025' && 'Windows' || 'Linux',
inputs.hypervisor == 'hyperv-ws2025' && 'win2025' || inputs.hypervisor == 'mshv3' && 'azlinux3-mshv' || inputs.hypervisor,
inputs.cpu,
inputs.config,
github.run_id,
github.run_number,
github.run_attempt)) }}
steps:
- uses: actions/checkout@v6
- uses: hyperlight-dev/ci-setup-workflow@v1.9.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fix cargo home permissions
if: runner.os == 'Linux'
run: |
sudo chown -R $(id -u):$(id -g) /opt/cargo || true
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "${{ runner.os }}-${{ inputs.config }}"
cache-on-failure: "true"
- name: Download Rust guests
uses: actions/download-artifact@v8
with:
name: rust-guests-${{ inputs.config }}
path: src/tests/rust_guests/bin/${{ inputs.config }}/
- name: Download C guests
uses: actions/download-artifact@v8
with:
name: c-guests-${{ inputs.config }}
path: src/tests/c_guests/bin/${{ inputs.config }}/
- name: Download interface.wasm
uses: actions/download-artifact@v8
with:
name: interface-wasm
path: src/tests/rust_guests/witguest/
- name: Download twoworlds.wasm
uses: actions/download-artifact@v8
with:
name: twoworlds-wasm
path: src/tests/rust_guests/witguest/
- name: Build
run: just build ${{ inputs.config }}
- name: Run Miri tests
if: runner.os == 'Linux'
run: just miri-tests
- name: Run Rust tests
run: |
# with default features
just test ${{ inputs.config }}
- name: Run Rust tests with single driver
if: runner.os == 'Linux'
run: |
# with only one driver enabled (kvm/mshv3 features are unix-only, no-op on Windows)
just test ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
- name: Run Rust tests with hw-interrupts
run: |
# with hw-interrupts feature enabled (+ explicit driver on Linux)
just test ${{ inputs.config }} ${{ runner.os == 'Linux' && (inputs.hypervisor == 'mshv3' && 'mshv3,hw-interrupts' || 'kvm,hw-interrupts') || 'hw-interrupts' }}
- name: Run Rust Gdb tests
env:
RUST_LOG: debug
run: just test-rust-gdb-debugging ${{ inputs.config }}
- name: Run Rust Crashdump tests
env:
RUST_LOG: debug
run: just test-rust-crashdump ${{ inputs.config }}
- name: Run Rust Tracing tests
if: runner.os == 'Linux'
env:
RUST_LOG: debug
run: just test-rust-tracing ${{ inputs.config }}