Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
ci: Set a timeout on qemu job and do not terminate with an error
Browse files Browse the repository at this point in the history
Add a separate ci script for testing on qemu.

Signed-off-by: Maxim Polyakov <[email protected]>
  • Loading branch information
maxpoliak committed Oct 29, 2021
1 parent 2046a19 commit 0513cf9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/action-build-all-i386.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'CI: i386: Build all. Test'
name: 'CI [i386] Full testing cycle'

on:
push:
Expand All @@ -16,7 +16,7 @@ env:

jobs:
build-all-components:
name: 'CI: i386: Build all'
name: 'CI [i386] Build all'
runs-on: ubuntu-latest
steps:
- name: 'Step 1: Clone the project repo'
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
path: ./*.exe
creating-qemu-image:
needs: build-all-components
name: 'CI: i386: Create the QEMU bootable image'
name: 'CI [i386] Create the QEMU bootable image'
runs-on: ubuntu-latest
steps:
- name: 'Step 1: Repo'
Expand Down Expand Up @@ -79,11 +79,12 @@ jobs:
name: '${{ env.VERSION }}-boot-disk-img-artifact'
path: boot-disk.img
test-on-qemu:
needs: creating-qemu-image
name: 'CI: i386: Create the QEMU bootable disk image'
needs: build-all-components
name: 'CI [i386] Run exe on QEMU'
runs-on: ubuntu-latest
continue-on-error: false
steps:
- name: 'Step 1: checkout Repo'
- name: 'Step 1: Checkout Repo'
uses: actions/[email protected]
with:
submodules: true
Expand All @@ -98,11 +99,9 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -yy qemu-system-i386
- name: 'Step 4: Dowmload artifact with the QEMU disk image'
- name: 'Step 4: Dowmload artifact with exe image'
uses: actions/download-artifact@v2
with:
name: '${{ env.VERSION }}-boot-disk-img-artifact'
- name: 'Step 5: Test the image on QEMU'
timeout-minutes: 10
run: |
qemu-system-i386 -m 128 -hda boot-disk.img -M q35 -nographic
name: '${{ env.VERSION }}-exe-artifact'
- name: 'Step 5: Test exe on QEMU'
run: timeout 5 ./ci/ci-test-exe-on-qemu.sh || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
8 changes: 8 additions & 0 deletions ci/ci-test-exe-on-qemu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

CI_DIR="$(dirname $(realpath ${BASH_SOURCE[0]}))"
ROOT_DIR="${CI_DIR}/.."

filename=$(basename ${ROOT_DIR}/*.exe)
echo "Run ${filename} on QEMU"
qemu-system-i386 -machine type=q35 -m 128 -no-reboot -append "--video=off --console=/dev/com1" -nographic -kernel ${ROOT_DIR}/$filename

0 comments on commit 0513cf9

Please sign in to comment.