feat: nobios mode, exercise docs & test cases, CI testing #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ "main", "lab" ] | |
| pull_request: | |
| branches: [ "main", "lab" ] | |
| workflow_dispatch: | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check format | |
| run: cargo fmt --all --check | |
| qemu-exercise: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| container: | |
| image: duskmoon/dev-env:rcore-ci | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ch: [3, 4, 5, 6, 8] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Sanity check toolchain in container | |
| run: | | |
| set -eux | |
| qemu-system-riscv64 --version | |
| python3 --version | |
| rustc --version | |
| cargo --version | |
| rustup --version | |
| - name: Mark workspace as safe git directory | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Checkout checker | |
| run: | | |
| git clone --depth 1 https://github.com/LearningOS/rCore-Tutorial-Checker-2025S.git checker | |
| - name: Install Rust components/targets | |
| run: | | |
| set -eux | |
| rustup target add riscv64gc-unknown-none-elf | |
| rustup component add rust-src llvm-tools-preview | |
| - name: Run exercise in QEMU and check output (ch${{ matrix.ch }}) | |
| run: | | |
| timeout 3m cargo qemu --ch ${{ matrix.ch }} --exercise --nobios --ci 2>&1 \ | |
| | python3 checker/check/ch${{ matrix.ch }}.py |