Lintestor Test (Decrepated) #47
This file contains 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: Lintestor Test | |
on: | |
schedule: | |
- cron: '0 2 * * 1' # 每周一凌晨2点运行 | |
workflow_dispatch: # 允许手动触发 | |
jobs: | |
test: | |
runs-on: [self-hosted, linux] | |
env: | |
PRINT_SSH_MSG: 1 | |
RUST_LOG: debug | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout dirty branch | |
uses: actions/checkout@v2 | |
with: | |
ref: 'dirty' | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libssl-dev # lintestor build dependencies | |
sudo apt-get install -y qemu-utils qemu-system-x86 qemu-system-misc opensbi u-boot-qemu | |
sudo apt-get install -y sshpass | |
- name: Setup Debian QEMU env for RISC-V | |
run: | | |
cd .. | |
wget -O rv64deb.zip "https://gitlab.com/api/v4/projects/giomasce%2Fdqib/jobs/artifacts/master/download?job=convert_riscv64-virt" | |
unzip rv64deb.zip | |
cd dqib_riscv64-virt | |
echo 'qemu-system-riscv64 -machine virt -m 1G -smp 8 -cpu rv64 \' > boot.sh | |
echo '-device virtio-blk-device,drive=hd \' >> boot.sh | |
echo '-drive file=image.qcow2,if=none,id=hd \' >> boot.sh | |
echo '-device virtio-net-device,netdev=net \' >> boot.sh | |
echo '-netdev user,id=net,hostfwd=tcp::2222-:22 \' >> boot.sh | |
echo '-bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.bin \' >> boot.sh | |
echo '-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \' >> boot.sh | |
echo '-object rng-random,filename=/dev/urandom,id=rng \' >> boot.sh | |
echo '-device virtio-rng-device,rng=rng \' >> boot.sh | |
echo '-nographic -append "root=LABEL=rootfs console=ttyS0 cmdline no4lvl"' >> boot.sh | |
chmod +x boot.sh | |
ls -l # 展示文件结构 | |
cd ../lintestor # 回到项目目录 | |
ls -l # 再次展示文件结构 | |
- name: Setup Fedora QEMU env for RISC-V | |
run: | | |
mkdir ../fedora | |
cp ./fedora/init.sh ../fedora | |
cp ./fedora/boot.sh ../fedora | |
cd ../fedora | |
chmod +x init.sh | |
chmod +x boot.sh | |
ls -l # 展示文件结构 | |
./init.sh | |
cd ../lintestor # 回到项目目录 | |
ls -l # 再次展示文件结构 | |
- name: Setup Bianbu remote credentials with ACTIONS SECRETs | |
env: | |
BIANBU_IP: ${{ secrets.BIANBU_IP }} | |
BIANBU_PORT: ${{ secrets.BIANBU_PORT }} | |
BIANBU_USERNAME: ${{ secrets.BIANBU_USERNAME }} | |
BIANBU_PASSWORD: ${{ secrets.BIANBU_PASSWORD }} | |
run: | | |
sed -i "s/{BIANBU_IP}/${BIANBU_IP}/" ./bianbu/config.toml | |
sed -i "s/{BIANBU_PORT}/${BIANBU_PORT}/" ./bianbu/config.toml | |
sed -i "s/{BIANBU_USERNAME}/${BIANBU_USERNAME}/" ./bianbu/config.toml | |
sed -i "s/{BIANBU_PASSWORD}/${BIANBU_PASSWORD}/" ./bianbu/config.toml | |
- name: Install & Run Lintestor | |
run: | | |
ls -l ../ # 展示上级文件结构 | |
ls -l ../dqib_riscv64-virt # 展示文件结构 | |
ls -l . # 展示本级结构 | |
# cargo run -- --test --aggr --summ | |
cargo install lintestor | |
LATEST_BINARY=lintestor | |
$LATEST_BINARY --test --aggr --summ | |
rm .gitignore | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: | | |
reports.json | |
summary.md | |
- name: Commit reports | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "test(report): weekly test reports update" | |
file_pattern: | | |
**/*.json | |
**/*/*.json | |
summary.md | |
reports.md |