-
Notifications
You must be signed in to change notification settings - Fork 163
139 lines (115 loc) · 4.07 KB
/
RustNightly.yml
File metadata and controls
139 lines (115 loc) · 4.07 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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Nightly
on:
workflow_dispatch:
schedule:
# 12:00 AM, every 2 days
- cron: '0 0 */2 * *'
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
defaults:
run:
shell: bash
jobs:
# Nightly musl cross-compilation builds
# This is a self-contained job since musl builds are a special case
# that require TARGET_TRIPLE for cross-compilation
musl:
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
hypervisor: [kvm, mshv3]
cpu: [amd, intel]
config: [debug, release]
runs-on: ${{ fromJson(
format('["self-hosted", "Linux", "X64", "1ES.Pool=hld-{0}-{1}"]',
matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor,
matrix.cpu)) }}
env:
TARGET_TRIPLE: x86_64-unknown-linux-musl
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-${{ matrix.config }}-${{ hashFiles('rust-toolchain.toml') }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "nightly-${{ matrix.config }}"
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: Build and move Rust guests
run: |
just build-rust-guests ${{ matrix.config }}
just move-rust-guests ${{ matrix.config }}
- name: Build C guests
run: |
just build-c-guests ${{ matrix.config }}
just move-c-guests ${{ matrix.config }}
- name: Build
run: just build ${{ matrix.config }}
- name: Run Miri tests
run: just miri-tests
- name: Run Rust tests
run: |
# with default features
just test ${{ matrix.config }}
# with only one driver enabled
just test ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
# make sure certain cargo features compile
just check
# without any features
just test-compilation-no-default-features ${{ matrix.config }}
- name: Run Rust examples
env:
RUST_LOG: debug
run: just run-rust-examples-linux ${{ matrix.config }}
- name: Run Rust Gdb tests
env:
RUST_LOG: debug
run: just test-rust-gdb-debugging ${{ matrix.config }}
- name: Run Rust Crashdump tests
env:
RUST_LOG: debug
run: just test-rust-crashdump ${{ matrix.config }}
- name: Run Rust Tracing tests
env:
RUST_LOG: debug
run: just test-rust-tracing ${{ matrix.config }}
notify-failure:
runs-on: ubuntu-latest
needs: musl
if: always() && needs.musl.result == 'failure'
permissions:
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Notify Nightly Failure
run: ./dev/notify-ci-failure.sh --title="Nightly musl Failure - ${{ github.run_number }}" --labels="area/ci-periodics,area/testing,lifecycle/needs-review,release-blocker"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}