Skip to content

[WIP] CI: attach QEMU test to packages workflow#21

Open
Ansuel wants to merge 4 commits into
mainfrom
dev
Open

[WIP] CI: attach QEMU test to packages workflow#21
Ansuel wants to merge 4 commits into
mainfrom
dev

Conversation

@Ansuel
Copy link
Copy Markdown
Member

@Ansuel Ansuel commented May 6, 2024

Attach QEMU test to packages workflow. This is still WIP as some test still needs some better handling.

The reusable workflow expect an artifact to be downloaded and tested. Currently only QEMU is supported, but it's expected that sometime in the future this is expanded also to labgrid and expanded also to other workflow... (maybe restrict this to push event?)

@Ansuel
Copy link
Copy Markdown
Member Author

Ansuel commented May 6, 2024

@aparcar the thing

- target: x86
subtarget: 64
use_qemu: true
qemu_target: x86
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add armsr/armv8 here, too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra 40 minutes for each run but yes

- name: Run test with QEMU
if: inputs.use_qemu == true
run: |
export LG_QEMU_BIN=$(which qemu-system-${{ inputs.qemu_target }})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found out you can drop the which wrapping, it was a path issue on my local device.

run: |
export LG_QEMU_BIN=$(which qemu-system-${{ inputs.qemu_target }})

poetry run pytest --lg-env target_${{ inputs.target }}-${{ inputs.subtarget }}.yaml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the target to qemu.yaml and instead added the --target argument. Also please checkout --firmware to specify the file, which should make things more elegant.

@Ansuel Ansuel force-pushed the dev branch 7 times, most recently from e4d1be9 to 92d33d6 Compare May 7, 2024 10:38
@Ansuel Ansuel force-pushed the main branch 10 times, most recently from 7ef03b6 to 0a3f3c9 Compare November 8, 2024 18:26
@Ansuel Ansuel force-pushed the main branch 2 times, most recently from 94e64ba to c7ec823 Compare July 24, 2025 13:33
Ansuel added 4 commits May 20, 2026 18:35
Add support for uploading compiled images if build_full is triggered.

This is in preparation for testing the images in QEMU if supported.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Introduce reusable test-image workflow. Currently only QEMU is
supported. This assume it's run after an artifact is uploaded by other
workflow.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add additional job to enable testing with QEMU using the new
reusable_test-image workflow.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Some images are compressed with .gz format, extract them to correctly
use them.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a reusable GitHub Actions workflow to test built OpenWrt images (currently via QEMU) and wires it into the existing packages workflow by uploading images from the build and downloading them for test execution.

Changes:

  • Introduce reusable_test-image.yml to download build artifacts and run pytest-based QEMU tests.
  • Extend reusable_build.yml with an upload_images input to publish compiled images as artifacts.
  • Add a QEMU test matrix job to packages.yml consuming the reusable test workflow.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/reusable_test-image.yml New reusable workflow to install deps, download image artifacts, and run QEMU-based tests.
.github/workflows/reusable_build.yml Adds optional image artifact upload to support downstream image testing.
.github/workflows/packages.yml Enables image upload in build job and introduces QEMU test matrix calling the reusable test workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +55 to +57
strategy:
fail-fast: False
matrix:
Comment on lines +37 to +42
sudo apt install python3-pip

- name: Install QEMU dependency
if: inputs.use_qemu == true
run: |
sudo apt install qemu-system-${{ inputs.qemu_target }}
Comment on lines +30 to +33
- name: Checkout
uses: actions/checkout@v4
with:
repository: aparcar/openwrt-tests
Comment on lines +56 to +58
# gunzip return 2 for warning hence we need to reset
if [ -f "${{ inputs.image }}.gz" ]; then
gunzip -q ${{ inputs.image }}.gz || true
run: |
# gunzip return 2 for warning hence we need to reset
if [ -f "${{ inputs.image }}.gz" ]; then
gunzip -q ${{ inputs.image }}.gz || true
poetry run pytest \
--lg-env tests/qemu.yaml \
--target ${{ inputs.target }}-${{ inputs.subtarget }} \
--firmware "$(pwd)"/${{ inputs.image }}
@github-actions
Copy link
Copy Markdown

Warning

Some formality checks failed.

Consider (re)reading submissions guidelines.

Failed checks

Issues marked with an ❌ are failing checks.

Commit 9862474

  • 🔶 Commit subject length: recommended max 60, required max 80 characters

Commit a87dbf0

  • 🔶 Commit subject length: recommended max 60, required max 80 characters

For more details, see the full job log.

Something broken? Consider providing feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants