-
Notifications
You must be signed in to change notification settings - Fork 93
76 lines (60 loc) · 2.9 KB
/
Benchmarks.yml
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Benchmarks
on:
workflow_call: # This is called from CreateRelease.yml
permissions:
id-token: write
contents: read
jobs:
# this job requires the build-guest-binaries job be complete prior to
# its execution. this dependency should be expressed in the dependent
# workflow
benchmark:
strategy:
fail-fast: true
matrix:
hypervisor: [hyperv, mshv, mshv3, kvm] # hyperv is windows, mshv and kvm are linux
cpu: [amd, intel]
config: [release] # don't want to benchmark debug-builds
runs-on: ${{ fromJson(format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}"]', matrix.hypervisor == 'hyperv' && 'Windows' || 'Linux', matrix.hypervisor == 'hyperv' && 'win2022' || matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor, matrix.cpu)) }}
steps:
### Setup ###
- uses: actions/checkout@v4
- uses: hyperlight-dev/[email protected]
with:
rust-toolchain: "1.81.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download Guest Binaries
uses: actions/download-artifact@v4
with:
name: guest-binaries-release
path: ./downloaded-guest-binaries-release
- name: Copy Guest Binaries
run: |
cp ./downloaded-guest-binaries-release/callbackguest ./src/tests/rust_guests/bin/release/callbackguest
cp ./downloaded-guest-binaries-release/callbackguest.exe ./src/tests/rust_guests/bin/release/callbackguest.exe
cp ./downloaded-guest-binaries-release/simpleguest ./src/tests/rust_guests/bin/release/simpleguest
cp ./downloaded-guest-binaries-release/simpleguest.exe ./src/tests/rust_guests/bin/release/simpleguest.exe
cp ./downloaded-guest-binaries-release/dummyguest ./src/tests/rust_guests/bin/release/dummyguest
### Benchmarks ###
- name: Install github-cli (Linux mariner)
if: runner.os == 'Linux' && matrix.hypervisor == 'hyperv'
run: sudo dnf install gh -y
- name: Install github-cli (Linux ubuntu)
if: runner.os == 'Linux' && matrix.hypervisor == 'kvm'
run: sudo apt install gh -y
- name: Fetch tags
run: git fetch --tags origin
- name: Download benchmarks from most recent release
run: just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} # skip tag parameter to compare to latest stable release
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Benchmarks
run: just bench-ci main release ${{ matrix.hypervisor == 'mshv3' && 'mshv3' || ''}}
- uses: actions/upload-artifact@v4
with:
name: benchmarks_${{runner.os}}_${{matrix.hypervisor}}_${{ matrix.cpu }}
path: ./target/criterion/
if-no-files-found: error