fix kill ci #10
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: Build Rust Doc And Run tests | |
on: [push] | |
env: | |
CARGO_TERM_COLOR: always | |
rust_toolchain: nightly-2024-01-18 | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: [riscv64, aarch64, x86_64, loongarch64] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ env.rust_toolchain }} | |
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-8.2.1 | |
key: qemu-8.2.1-x86_64-riscv64 | |
- name: Install QEMU | |
run: | | |
echo ${{ github.workspace }} | |
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip | |
unzip ninja-linux.zip | |
sudo mv ninja /usr/local/bin/ | |
ninja --version | |
if [ ! -d qemu-8.2.1 ]; then | |
wget https://download.qemu.org/qemu-8.2.1.tar.xz | |
tar -xf qemu-8.2.1.tar.xz | |
cd qemu-8.2.1 | |
./configure --target-list=riscv64-softmmu,x86_64-softmmu,loongarch64-softmmu,aarch64-softmmu | |
make -j | |
else | |
cd qemu-8.2.1 | |
fi | |
sudo make install | |
qemu-system-riscv64 --version | |
qemu-system-aarch64 --version | |
qemu-system-loongarch64 --version | |
qemu-system-x86_64 --version | |
- name: Run usertests in ${{ matrix.arch }} | |
run: | | |
cd os | |
(make run ARCH=${{ matrix.arch }} & echo $! > pidfile) | while IFS= read -r line | |
do | |
echo "$line" | |
if echo "$line" | grep -q "All applications completed!" | |
then | |
if ps -p $(cat pidfile) > /dev/null | |
then | |
kill $(cat pidfile) | |
fi | |
exit 0 | |
fi | |
done | |
timeout-minutes: 4 |