|
| 1 | +name: Build Rust Doc And Run tests |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +env: |
| 6 | + CARGO_TERM_COLOR: always |
| 7 | + rust_toolchain: nightly-2024-01-18 |
| 8 | + |
| 9 | +jobs: |
| 10 | + build-doc: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v3 |
| 14 | + - uses: actions-rs/toolchain@v1 |
| 15 | + with: |
| 16 | + profile: minimal |
| 17 | + toolchain: ${{ env.rust_toolchain }} |
| 18 | + components: rust-src, llvm-tools-preview |
| 19 | + target: riscv64gc-unknown-none-elf |
| 20 | + - name: Build doc |
| 21 | + run: cd os && cargo doc --no-deps --verbose |
| 22 | + - name: Deploy to Github Pages |
| 23 | + uses: peaceiris/actions-gh-pages@v3 |
| 24 | + with: |
| 25 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + publish_dir: ./os/target/riscv64gc-unknown-none-elf/doc |
| 27 | + destination_dir: ${{ github.ref_name }} |
| 28 | + |
| 29 | + run-tests: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v3 |
| 33 | + - uses: actions-rs/toolchain@v1 |
| 34 | + with: |
| 35 | + profile: minimal |
| 36 | + toolchain: ${{ env.rust_toolchain }} |
| 37 | + components: rust-src, llvm-tools-preview |
| 38 | + target: riscv64gc-unknown-none-elf |
| 39 | + - uses: actions-rs/install@v0.1 |
| 40 | + with: |
| 41 | + crate: cargo-binutils |
| 42 | + version: latest |
| 43 | + use-tool-cache: true |
| 44 | + - name: Cache QEMU |
| 45 | + uses: actions/cache@v3 |
| 46 | + with: |
| 47 | + path: qemu-7.0.0 |
| 48 | + key: qemu-7.0.0-x86_64-riscv64 |
| 49 | + - name: Install QEMU |
| 50 | + run: | |
| 51 | + sudo apt-get update |
| 52 | + sudo apt-get install ninja-build -y |
| 53 | + if [ ! -d qemu-7.0.0 ]; then |
| 54 | + wget https://download.qemu.org/qemu-7.0.0.tar.xz |
| 55 | + tar -xf qemu-7.0.0.tar.xz |
| 56 | + cd qemu-7.0.0 |
| 57 | + ./configure --target-list=riscv64-softmmu |
| 58 | + make -j |
| 59 | + else |
| 60 | + cd qemu-7.0.0 |
| 61 | + fi |
| 62 | + sudo make install |
| 63 | + qemu-system-riscv64 --version |
| 64 | +
|
| 65 | + - name: Run usertests |
| 66 | + run: cd os && make run TEST=1 |
| 67 | + timeout-minutes: 10 |
| 68 | + |
0 commit comments