Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
131 lines (116 loc) · 4.21 KB
/
Copy pathaction.yml
File metadata and controls
131 lines (116 loc) · 4.21 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-action.json
name: "Hyperlight Workflow Setup"
description: "Common setup steps for GitHub workflows in the Hyperlight project"
inputs:
additional-toolchain-directory:
description: "Optional directory containing another Rust toolchain file."
required: false
just-version:
description: '(Default: 1.41) Version of just to install.'
required: false
default: '1.41'
runs:
using: composite
steps:
- name: Set up user-local Homebrew (macOS)
if: ${{ runner.os == 'macOS' }}
run: |
prefix="$HOME/.homebrew"
if [ ! -x "$prefix/bin/brew" ]; then
git clone --depth=1 https://github.com/Homebrew/brew.git "$prefix"
fi
printf '%s\n' "$prefix/bin" "$prefix/sbin" >> "$GITHUB_PATH"
shell: bash
- name: Preserve development debug information
run: |
if [ -z "${CARGO_PROFILE_DEV_DEBUG+x}" ]; then
echo "CARGO_PROFILE_DEV_DEBUG=2" >> "$GITHUB_ENV"
fi
shell: bash
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2
with:
cache: 'false'
matcher: 'false'
build-warnings: ''
- name: Install additional Rust toolchain
if: ${{ inputs.additional-toolchain-directory != '' }}
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2
with:
rust-src-dir: ${{ inputs.additional-toolchain-directory }}
cache: 'false'
matcher: 'false'
build-warnings: ''
- uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
with:
just-version: ${{ inputs.just-version }}
### Linux setup ###
- name: Install clang-tools (Linux mariner)
if: ${{ (runner.os == 'Linux') }}
run: |
if command -v dnf > /dev/null 2>&1; then
if command -v clang > /dev/null 2>&1; then
echo "clang already installed"
else
sudo dnf remove clang -y || true
sudo dnf install clang -y
sudo dnf install clang-tools-extra -y
fi
if command -v lld > /dev/null 2>&1; then
echo "lld already installed"
else
sudo dnf remove lld -y || true
sudo dnf install lld -y
fi
clang --version
ld.lld --version
fi
shell: bash
- name: Install clang-tools (Linux ubuntu)
if: ${{ (runner.os == 'Linux') }}
run: |
if command -v apt > /dev/null 2>&1; then
if [ -x /usr/lib/llvm-18/bin/clang ] && [ -x /usr/lib/llvm-18/bin/ld.lld ]; then
echo "clang 18 and lld 18 already installed"
else
# apt.llvm.org has no LLVM 18 for Ubuntu 26.04 and later. The Ubuntu archive has it.
sudo apt-get update
# A stalled mirror can otherwise hang the job until its timeout.
if ! sudo timeout 600 apt-get -o Acquire::Retries=3 install -y clang-18 lld-18; then
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
sudo ./llvm.sh 18
fi
fi
# Runner images can link clang and ld.lld to a newer default LLVM.
sudo ln -sf /usr/lib/llvm-18/bin/clang /usr/bin/clang
sudo ln -sf /usr/lib/llvm-18/bin/ld.lld /usr/bin/ld.lld
clang --version
ld.lld --version
fi
shell: bash
- name: Set up env vars (Linux)
if: ${{ (runner.os == 'Linux') }}
run: |
set -x
if command -v dnf > /dev/null 2>&1; then
echo "Detected mariner / hyperv"
ls -al /dev/mshv
else
echo "Detected Ubuntu / kvm"
sudo ls -al /dev/kvm
fi
whoami
groups
echo "RUST_BACKTRACE=full" >> $GITHUB_ENV
shell: bash
### Windows setup ###
- name: Enable WHP on Windows
if: ${{ (runner.os == 'Windows') }}
run: Enable-WindowsOptionalFeature -Online -FeatureName HyperVisorPlatform
shell: pwsh
- name: Set up env vars (Windows)
if: ${{ (runner.os == 'Windows') }}
run: |
echo "RUST_BACKTRACE=full" >> $GITHUB_ENV
shell: pwsh