Repository navigation
100 lines (88 loc) · 3.57 KB
/
Copy pathdep_run_examples.yml
File metadata and controls
100 lines (88 loc) · 3.57 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Run Examples
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_vendor:
description: CPU vendor for the build (passed from caller matrix)
required: true
type: string
arch:
description: CPU architecture for the build (passed from caller matrix)
required: true
type: string
mshv_kernel:
description: MSHV kernel of the Azure Linux 3 pool, for example 6.18. Empty selects the default mshv3 pool.
required: false
type: string
default: ""
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
run-examples:
if: ${{ inputs.docs_only == 'false' }}
timeout-minutes: ${{ fromJSON(vars.RUN_EXAMPLES_JOB_TIMEOUT || '15') }}
runs-on: ${{ fromJson(inputs.arch == 'X64'
&& format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}", "JobId=run-examples-{3}-{4}-{5}-{6}"]',
inputs.hypervisor == 'hyperv-ws2025' && 'Windows' || 'Linux',
inputs.hypervisor == 'hyperv-ws2025' && 'win2025' || inputs.hypervisor == 'mshv3' && format('azlinux3-mshv{0}', inputs.mshv_kernel != '' && format('-{0}', inputs.mshv_kernel) || '') || inputs.hypervisor,
inputs.cpu_vendor,
inputs.config,
github.run_id,
github.run_number,
github.run_attempt)
|| format('["self-hosted", "{0}", "arm64", "{1}"]',
inputs.hypervisor == 'hvf' && 'macOS' || 'Linux',
inputs.hypervisor)) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: hyperlight-dev/ci-setup-workflow@59673866360458f8dd035f4a9fa766aeebad2038 # v2.3.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Rust cache
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
prefix-key: v1-rust
# Concurrent macOS runners share ~/.cargo/bin, so cleanup can remove Cargo from another job.
cache-bin: ${{ runner.os != 'macOS' }}
shared-key: "${{ inputs.arch }}-${{ runner.os }}-${{ inputs.hypervisor }}-${{ inputs.config }}"
save-if: "false"
- name: Download Rust guests
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: rust-guests-${{ inputs.arch }}-${{ inputs.config }}
path: src/tests/rust_guests/bin/${{ inputs.config }}/
- name: Download C guests
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: c-guests-${{ inputs.arch }}-${{ inputs.config }}
path: src/tests/c_guests/bin/${{ inputs.config }}/
- name: Run Rust examples - windows and macOS
if: runner.os == 'Windows' || runner.os == 'macOS'
env:
RUST_LOG: debug
run: just run-rust-examples ${{ inputs.config }}
- name: Run Rust examples - linux
if: runner.os == 'Linux'
env:
RUST_LOG: debug
run: just run-rust-examples-linux ${{ inputs.config }}