-
Notifications
You must be signed in to change notification settings - Fork 163
163 lines (134 loc) · 5.23 KB
/
dep_code_checks.yml
File metadata and controls
163 lines (134 loc) · 5.23 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Code Checks
on:
workflow_call:
inputs:
docs_only:
description: Skip building if docs only
required: false
type: string
default: "false"
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
linux-checks:
if: ${{ inputs.docs_only == 'false' }}
timeout-minutes: 30
runs-on: ["self-hosted", "Linux", "X64", "1ES.Pool=hld-kvm-amd"]
steps:
- uses: actions/checkout@v6
- uses: hyperlight-dev/ci-setup-workflow@v1.8.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fix cargo home permissions
run: |
sudo chown -R $(id -u):$(id -g) /opt/cargo || true
# cargo-hyperlight builds a custom sysroot for x86_64-hyperlight-none target.
# rust-cache cleans "anything not a dependency" from target dirs, removing the sysroot.
# We cache sysroot separately to avoid rebuilding it (~10s) on every run.
- name: Sysroot cache
uses: actions/cache@v5
with:
path: |
src/tests/rust_guests/simpleguest/target/sysroot
src/tests/rust_guests/dummyguest/target/sysroot
src/tests/rust_guests/witguest/target/sysroot
key: sysroot-linux-${{ hashFiles('rust-toolchain.toml') }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "code-checks-linux"
cache-on-failure: "true"
workspaces: |
. -> target
src/tests/rust_guests/simpleguest -> target
src/tests/rust_guests/dummyguest -> target
src/tests/rust_guests/witguest -> target
- name: Ensure up-to-date Cargo.lock
run: |
cargo fetch --locked
cargo fetch --manifest-path src/tests/rust_guests/simpleguest/Cargo.toml --locked
cargo fetch --manifest-path src/tests/rust_guests/dummyguest/Cargo.toml --locked
cargo fetch --manifest-path src/tests/rust_guests/witguest/Cargo.toml --locked
- name: fmt
run: just fmt-check
- name: clippy exhaustive check (debug)
run: just clippy-exhaustive debug
- name: clippy exhaustive check (release)
run: just clippy-exhaustive release
- name: Verify MSRV
run: ./dev/verify-msrv.sh hyperlight-host hyperlight-guest hyperlight-guest-bin hyperlight-common
- name: Check 32-bit builds (Nanvix compatibility)
run: |
rustup target add i686-unknown-linux-gnu
just check-i686 debug
- name: Check cargo features compile
run: just check
- name: Check compilation with no default features
run: |
just test-compilation-no-default-features debug
just test-compilation-no-default-features release
windows-checks:
if: ${{ inputs.docs_only == 'false' }}
timeout-minutes: 30
runs-on: ["self-hosted", "Windows", "X64", "1ES.Pool=hld-win2025-amd"]
steps:
- uses: actions/checkout@v6
- uses: hyperlight-dev/ci-setup-workflow@v1.8.0
with:
rust-toolchain: "1.89"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# cargo-hyperlight builds a custom sysroot for x86_64-hyperlight-none target.
# rust-cache cleans "anything not a dependency" from target dirs, removing the sysroot.
# We cache sysroot separately to avoid rebuilding it (~10s) on every run.
- name: Sysroot cache
uses: actions/cache@v5
with:
path: |
src/tests/rust_guests/simpleguest/target/sysroot
src/tests/rust_guests/dummyguest/target/sysroot
src/tests/rust_guests/witguest/target/sysroot
key: sysroot-windows-${{ hashFiles('rust-toolchain.toml') }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "code-checks-windows"
cache-on-failure: "true"
workspaces: |
. -> target
src/tests/rust_guests/simpleguest -> target
src/tests/rust_guests/dummyguest -> target
src/tests/rust_guests/witguest -> target
- name: Ensure up-to-date Cargo.lock
run: |
cargo fetch --locked
cargo fetch --manifest-path src/tests/rust_guests/simpleguest/Cargo.toml --locked
cargo fetch --manifest-path src/tests/rust_guests/dummyguest/Cargo.toml --locked
cargo fetch --manifest-path src/tests/rust_guests/witguest/Cargo.toml --locked
- name: fmt
run: just fmt-check
- name: clippy (debug)
run: |
just clippy debug
just clippy-guests debug
- name: clippy (release)
run: |
just clippy release
just clippy-guests release
- name: Verify MSRV
run: ./dev/verify-msrv.sh hyperlight-host hyperlight-guest hyperlight-guest-bin hyperlight-common
- name: Check cargo features compile
run: just check
- name: Check compilation with no default features
run: |
just test-compilation-no-default-features debug
just test-compilation-no-default-features release