Skip to content

Commit

Permalink
Add CI for Rust w/ RISC-V
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Guo <gary@garyguo.net>
  • Loading branch information
nbdd0121 committed Apr 27, 2021
1 parent 87447f4 commit 688902f
Show file tree
Hide file tree
Showing 3 changed files with 2,809 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
# Exclude `LLVM=1` where not supported.
- arch: ppc64le
toolchain: llvm
- arch: riscv64
toolchain: llvm

# A few independent combinations to avoid exploding the matrix:
# - The other option for `output`.
Expand Down Expand Up @@ -92,6 +94,15 @@ jobs:
echo 'QEMU_ARCH=arm' >> $GITHUB_ENV
echo 'QEMU_MACHINE=virt' >> $GITHUB_ENV
echo 'QEMU_CPU=cortex-a7' >> $GITHUB_ENV
- if: matrix.arch == 'riscv64'
run: |
echo 'MAKE_ARCH=ARCH=riscv' >> $GITHUB_ENV
echo 'MAKE_CROSS_COMPILE=CROSS_COMPILE=riscv64-linux-gnu-' >> $GITHUB_ENV
echo 'IMAGE_PATH=arch/riscv/boot/Image' >> $GITHUB_ENV
echo 'QEMU_ARCH=riscv64' >> $GITHUB_ENV
echo 'QEMU_MACHINE=virt' >> $GITHUB_ENV
echo 'QEMU_CPU=rv64' >> $GITHUB_ENV
echo 'QEMU_ARGS=-bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf' >> $GITHUB_ENV
- if: matrix.toolchain == 'clang'
run: echo 'MAKE_TOOLCHAIN=CC=clang-11' >> $GITHUB_ENV
Expand Down Expand Up @@ -122,6 +133,12 @@ jobs:
run: sudo apt-get install -y gcc-aarch64-linux-gnu
- if: matrix.arch == 'ppc64le'
run: sudo apt-get install -y gcc-powerpc64le-linux-gnu
- if: matrix.arch == 'riscv64'
run: sudo apt-get install -y gcc-riscv64-linux-gnu

# Setup OpenSBI
- if: matrix.arch == 'riscv64'
run: sudo apt-get install -y opensbi

# Setup: libelf
- run: sudo apt-get install -y libelf-dev
Expand All @@ -133,6 +150,8 @@ jobs:
run: sudo apt-get install -y qemu-system-arm
- if: matrix.arch == 'ppc64le'
run: sudo apt-get install -y qemu-system-ppc
- if: matrix.arch == 'riscv64'
run: sudo apt-get install -y qemu-system-misc

# Setup: rustc
- if: matrix.install == 'rustup'
Expand Down Expand Up @@ -205,6 +224,7 @@ jobs:

- run: |
qemu-system-${{ env.QEMU_ARCH }} \
${{ env.QEMU_ARGS }} \
-kernel ${{ env.BUILD_DIR }}${{ env.IMAGE_PATH }} \
-initrd qemu-initramfs.img \
-M ${{ env.QEMU_MACHINE }} \
Expand Down
Loading

0 comments on commit 688902f

Please sign in to comment.