forked from arceos-org/oscamp
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (74 loc) · 2.86 KB
/
Copy pathci.yml
File metadata and controls
78 lines (74 loc) · 2.86 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
name: CI
on: [push, pull_request]
jobs:
setup-and-test-tour:
runs-on: ubuntu-latest
env:
qemu-version: 9.2.1
rust-version: nightly-2024-09-04
# When musl.cc is unreachable: set MUSL_CC_BASE_URL (no trailing slash) to a folder that
# hosts the same filenames as musl.cc, e.g. …/releases/download/toolchains
MUSL_CC_BASE_URL: ${{ vars.MUSL_CC_BASE_URL }}
# Or set MUSL_CC_URL_OVERRIDE to one full .tgz URL (only useful for a single-arch workflow).
MUSL_CC_URL_OVERRIDE: ${{ vars.MUSL_CC_URL_OVERRIDE }}
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
wget \
xxd \
curl \
gcc \
g++ \
make \
libclang-dev \
bash \
sudo \
git \
dosfstools \
build-essential \
pkg-config \
libssl-dev \
libz-dev \
libclang-dev
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust-version }}
components: rust-src, llvm-tools, clippy, rustfmt
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat, loongarch64-unknown-none
- uses: Swatinem/rust-cache@v2
# Do not `cargo install cargo-binutils`: recent releases pull clap/hashbrown
# that require edition2024 / Rust 1.85, which breaks on nightly-2024-09-04.
- name: Setup rust-objcopy / rust-objdump (from llvm-tools)
run: |
mkdir -p "$HOME/.cargo/bin"
SYSROOT=$(rustc --print sysroot)
HOST=$(rustc -vV | sed -n 's/^host: //p')
LLVM_BIN="$SYSROOT/lib/rustlib/$HOST/bin"
cp "$LLVM_BIN/llvm-objcopy" "$HOME/.cargo/bin/rust-objcopy"
cp "$LLVM_BIN/llvm-objdump" "$HOME/.cargo/bin/rust-objdump"
# llvm-objcopy is dynamically linked against libLLVM in the sysroot; ~/.cargo/bin is not in its rpath.
echo "LD_LIBRARY_PATH=${SYSROOT}/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV"
LD_LIBRARY_PATH="${SYSROOT}/lib:${LD_LIBRARY_PATH:-}" rust-objcopy --version
- name: Check rust version
run: rustc --version --verbose
- uses: ./.github/workflows/actions/setup-musl
with:
arch: x86_64
- uses: ./.github/workflows/actions/setup-musl
with:
arch: riscv64
- uses: ./.github/workflows/actions/setup-musl
with:
arch: aarch64
- uses: ./.github/workflows/actions/setup-musl
with:
arch: loongarch64
- uses: ./.github/workflows/actions/setup-qemu
with:
qemu-version: ${{ env.qemu-version }}
- name: Run tour
run: |
./scripts/tour_test.sh