ci: cache qemu

update: .gitignore, .vscode/settings.json
This commit is contained in:
YdrMaster 2022-05-14 23:44:09 +08:00
parent 8e73480c99
commit c9a288c110
3 changed files with 55 additions and 30 deletions

View File

@ -9,37 +9,57 @@ jobs:
build-doc: build-doc:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: 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 - name: Build doc
run: | run: cd os && cargo doc --no-deps --verbose
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
- name: Deploy to Github Pages - name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./os/target/riscv64gc-unknown-none-elf/doc publish_dir: ./os/target/riscv64gc-unknown-none-elf/doc
destination_dir: ${{ github.ref_name }} destination_dir: ${{ github.ref_name }}
run-tests: run-tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: 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 - name: Install QEMU
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install ninja-build -y sudo apt-get install ninja-build -y
[ ! -d qemu-6.1.0 ] && wget https://download.qemu.org/qemu-6.1.0.tar.xz \ if [ ! -d qemu-7.0.0 ]; then
&& tar xJf qemu-6.1.0.tar.xz > /dev/null \ wget https://download.qemu.org/qemu-7.0.0.tar.xz
&& cd qemu-6.1.0 && ./configure --target-list=riscv64-softmmu && cd .. tar -xf qemu-7.0.0.tar.xz
cd qemu-6.1.0 && sudo make install -j 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 qemu-system-riscv64 --version
- name: Run usertests
run: |
cd os && make run TEST=1
- name: Run usertests
run: cd os && make run TEST=1

19
.gitignore vendored
View File

@ -1,18 +1,13 @@
.idea/* .*/*
os/target/* !.github/*
os/.idea/* !.vscode/settings.json
**/target/
**/Cargo.lock
os/src/link_app.S os/src/link_app.S
os/src/linker.ld os/src/linker.ld
os/last-* os/last-*
os/Cargo.lock
os/last-*
os/.gdb_history 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/ tools/
pushall.sh pushall.sh

10
.vscode/settings.json vendored Normal file
View File

@ -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
}