tiny_os/.github/workflows/rust.yml

47 lines
1.0 KiB
YAML
Raw Normal View History

2023-12-17 20:47:05 +08:00
name: Rust
2024-02-16 19:22:06 +08:00
on: [ push, pull_request ]
2023-12-17 20:47:05 +08:00
env:
CARGO_TERM_COLOR: always
2024-02-16 21:07:03 +08:00
CLICOLOR_FORCE: 1
2023-12-17 20:47:05 +08:00
jobs:
build:
2024-04-12 23:57:45 +08:00
strategy:
matrix:
mode: [ debug, release ]
2024-04-12 23:57:45 +08:00
include:
- arch: riscv64
2024-05-05 00:06:43 +08:00
qemu-pkg: qemu-system-misc
rust-target: riscv64imac-unknown-none-elf
2024-04-12 23:57:45 +08:00
2023-12-17 20:47:05 +08:00
runs-on: ubuntu-latest
2024-05-05 00:06:43 +08:00
env:
ARCH: ${{ matrix.arch }}
2023-12-17 20:47:05 +08:00
steps:
2024-05-06 01:04:07 +08:00
- uses: actions/checkout@v4
2024-02-16 20:59:09 +08:00
- name: Install Qemu
uses: ConorMacBride/install-package@v1
with:
2024-05-05 00:06:43 +08:00
apt: ${{ matrix.qemu-pkg }}
2024-02-16 20:59:09 +08:00
- name: Install Rust
uses: dtolnay/rust-toolchain@master
2024-02-16 18:51:17 +08:00
with:
toolchain: nightly
2024-05-05 00:06:43 +08:00
targets: ${{ matrix.rust-target }}
2024-04-12 22:24:22 +08:00
components: clippy, rust-src
2024-02-16 20:59:09 +08:00
2024-04-12 22:21:08 +08:00
- name: Run Clippy
run: make clippy ARCH=${{ matrix.arch }} MODE=${{ matrix.mode }}
2024-04-12 23:57:45 +08:00
- name: Test
run: make test ARCH=${{ matrix.arch }} MODE=${{ matrix.mode }}
2024-05-05 00:06:43 +08:00
- name: Build
run: make kernel ARCH=${{ matrix.arch }} MODE=${{ matrix.mode }}