Skip to content

[dockerfile] prepare toolchain #1836

[dockerfile] prepare toolchain

[dockerfile] prepare toolchain #1836

Workflow file for this run

name: Build CI
on: [push, pull_request]
jobs:
clippy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64, riscv64, aarch64]
rust-toolchain: [nightly, nightly-2024-12-25]
env:
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-toolchain }}
components: rust-src, clippy, rustfmt
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat
- uses: Swatinem/rust-cache@v2
- name: Check rust version
run: rustc --version --verbose
- name: Check code format
if: ${{ matrix.arch == 'x86_64' }}
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: cargo fmt --all -- --check
- name: Clippy for the default target
if: ${{ matrix.arch == 'x86_64' }}
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make clippy
- name: Clippy for ${{ matrix.arch }}
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make clippy ARCH=${{ matrix.arch }}
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [x86_64, riscv64, aarch64]
rust-toolchain: [nightly, nightly-2024-12-25]
env:
RUSTUP_TOOLCHAIN: ${{ matrix.rust-toolchain }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-toolchain }}
components: rust-src, llvm-tools
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-binutils
- name: Build helloworld
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/helloworld
- name: Build httpclient
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/httpclient
- name: Build httpserver
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/httpserver
- name: Build shell
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/shell
- uses: ./.github/workflows/actions/setup-musl
with:
arch: ${{ matrix.arch }}
- name: Build helloworld-c
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/helloworld-c
- name: Build httpclient-c
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/httpclient-c
- name: Build httpserver-c
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make ARCH=${{ matrix.arch }} A=examples/httpserver-c
build-for-other-platforms:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
rust-toolchain: [nightly, nightly-2024-12-25]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-toolchain }}
components: rust-src, llvm-tools
targets: x86_64-unknown-none, riscv64gc-unknown-none-elf, aarch64-unknown-none, aarch64-unknown-none-softfloat
- uses: Swatinem/rust-cache@v2
- run: cargo install cargo-binutils
- name: Build helloworld for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/helloworld
- name: Build httpclient for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpclient FEATURES=page-alloc-4g,driver-ixgbe
- name: Build httpserver for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpserver FEATURES=page-alloc-4g,driver-ixgbe
- name: Build shell for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/shell FEATURES=page-alloc-4g,driver-ramdisk
- run: make PLATFORM=aarch64-raspi4 defconfig
- name: Build helloworld for aarch64-raspi4
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=aarch64-raspi4 SMP=4 A=examples/helloworld
- name: Build shell for aarch64-raspi4
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=aarch64-raspi4 SMP=4 A=examples/shell FEATURES=page-alloc-4g,driver-bcm2835-sdhci BUS=mmio
- run: make PLATFORM=aarch64-bsta1000b defconfig
- name: Build helloworld for aarch64-bsta1000b
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=aarch64-bsta1000b A=examples/helloworld SMP=8
- run: make PLATFORM=aarch64-phytium-pi defconfig
- name: Build helloworld for aarch64-phytium-pi
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=aarch64-phytium-pi A=examples/helloworld SMP=4
- uses: ./.github/workflows/actions/setup-musl
with:
arch: x86_64
- run: make PLATFORM=x86_64-pc-oslab defconfig
- name: Build helloworld-c for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/helloworld-c
- name: Build httpclient-c for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpclient-c FEATURES=page-alloc-4g,driver-ixgbe
- name: Build httpserver-c for x86_64-pc-oslab
continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }}
run: make PLATFORM=x86_64-pc-oslab A=examples/httpserver-c FEATURES=page-alloc-4g,driver-ixgbe