QEMU test #127
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: QEMU test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' | |
env: | |
PYTHONUNBUFFERED: "1" | |
jobs: | |
test: | |
name: Test OpenWrt QEMU | |
runs-on: ubuntu-24.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: malta-be | |
firmware: openwrt-malta-be-vmlinux-initramfs.elf | |
dependency: qemu-system-mips | |
- target: x86-64 | |
firmware: openwrt-x86-64-generic-squashfs-combined.img.gz | |
dependency: qemu-system-x86 | |
- target: armsr-armv8 | |
firmware: openwrt-armsr-armv8-generic-initramfs-kernel.bin | |
dependency: qemu-system-aarch64 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install \ | |
python3-poetry \ | |
${{ matrix.dependency }} | |
- name: Install project dependencies | |
run: | | |
poetry install | |
- name: Download test firmware | |
env: | |
target: ${{ matrix.target }} | |
run: | | |
wget https://downloads.openwrt.org/snapshots/targets/${target/-/\/}/${{ matrix.firmware }} \ | |
--output-document ${{ matrix.firmware }} | |
- name: Run test | |
run: | | |
gunzip ${{ matrix.firmware }} || true | |
firmware=${{ matrix.firmware }} | |
poetry run pytest tests/ \ | |
--lg-env targets/qemu-${{ matrix.target }}.yaml \ | |
--lg-log \ | |
--lg-colored-steps \ | |
-v \ | |
-s \ | |
--firmware $GITHUB_WORKSPACE/${firmware/.gz/} | |
- name: Upload console logs | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: console-${{ matrix.target }} | |
path: console_* | |
- name: Upload results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: results-${{ matrix.target }} | |
path: results.json |