|
| 1 | +name: Run tests |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +env: |
| 6 | + CARGO_TERM_COLOR: always |
| 7 | + rust_toolchain: nightly-2025-02-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 autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \ |
| 53 | + gawk build-essential bison flex texinfo gperf libtool patchutils bc \ |
| 54 | + zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev libsdl2-dev libslirp-dev \ |
| 55 | + python3 python3-pip ninja-build -y |
| 56 | + if [ ! -d qemu-7.0.0 ]; then |
| 57 | + wget https://download.qemu.org/qemu-7.0.0.tar.xz |
| 58 | + tar -xf qemu-7.0.0.tar.xz |
| 59 | + cd qemu-7.0.0 |
| 60 | + ./configure --target-list=riscv64-softmmu |
| 61 | + make -j |
| 62 | + else |
| 63 | + cd qemu-7.0.0 |
| 64 | + fi |
| 65 | + sudo make install |
| 66 | + qemu-system-riscv64 --version |
| 67 | +
|
| 68 | + - name: Run usertests |
| 69 | + run: cd os && make run TEST=1 |
| 70 | + timeout-minutes: 10 |
| 71 | + |
0 commit comments