diff --git a/.github/workflows/doc-and-test.yml b/.github/workflows/doc-and-test.yml index 26524710..91927a3d 100644 --- a/.github/workflows/doc-and-test.yml +++ b/.github/workflows/doc-and-test.yml @@ -9,37 +9,57 @@ jobs: build-doc: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2022-04-11 + components: rust-src, llvm-tools-preview + target: riscv64gc-unknown-none-elf - name: Build doc - run: | - rustup target add riscv64gc-unknown-none-elf - rustup component add llvm-tools-preview - rustup component add rust-src - cd os - cargo doc --no-deps --verbose + run: cd os && cargo doc --no-deps --verbose - name: Deploy to Github Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./os/target/riscv64gc-unknown-none-elf/doc destination_dir: ${{ github.ref_name }} + run-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2022-04-11 + components: rust-src, llvm-tools-preview + target: riscv64gc-unknown-none-elf + - uses: actions-rs/install@v0.1 + with: + crate: cargo-binutils + version: latest + use-tool-cache: true + - name: Cache QEMU + uses: actions/cache@v3 + with: + path: qemu-7.0.0 + key: qemu-7.0.0-x86_64-riscv64 - name: Install QEMU run: | sudo apt-get update sudo apt-get install ninja-build -y - [ ! -d qemu-6.1.0 ] && wget https://download.qemu.org/qemu-6.1.0.tar.xz \ - && tar xJf qemu-6.1.0.tar.xz > /dev/null \ - && cd qemu-6.1.0 && ./configure --target-list=riscv64-softmmu && cd .. - cd qemu-6.1.0 && sudo make install -j + if [ ! -d qemu-7.0.0 ]; then + wget https://download.qemu.org/qemu-7.0.0.tar.xz + tar -xf qemu-7.0.0.tar.xz + cd qemu-7.0.0 + ./configure --target-list=riscv64-softmmu + make -j + else + cd qemu-7.0.0 + fi + sudo make install qemu-system-riscv64 --version - - name: Run usertests - run: | - cd os && make run TEST=1 - - - \ No newline at end of file + - name: Run usertests + run: cd os && make run TEST=1 diff --git a/.gitignore b/.gitignore index 80614cf9..f411b223 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,13 @@ -.idea/* -os/target/* -os/.idea/* +.*/* +!.github/* +!.vscode/settings.json + +**/target/ +**/Cargo.lock + os/src/link_app.S os/src/linker.ld os/last-* -os/Cargo.lock -os/last-* os/.gdb_history -user/target/* -user/.idea/* -user/Cargo.lock -easy-fs/Cargo.lock -easy-fs/target/* -easy-fs-fuse/Cargo.lock -easy-fs-fuse/target/* tools/ pushall.sh diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..11de1111 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + // Prevent "can't find crate for `test`" error on no_std + // Ref: https://github.com/rust-lang/vscode-rust/issues/729 + // For vscode-rust plugin users: + "rust.target": "riscv64gc-unknown-none-elf", + "rust.all_targets": false, + // For Rust Analyzer plugin users: + "rust-analyzer.cargo.target": "riscv64gc-unknown-none-elf", + "rust-analyzer.checkOnSave.allTargets": false +}