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

Commit

Permalink
ci: action: Use script to test qemu disk image
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Polyakov <[email protected]>
  • Loading branch information
maxpoliak committed Oct 29, 2021
1 parent 0513cf9 commit d3140df
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/action-build-all-i386.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
with:
name: '${{ env.VERSION }}-boot-disk-img-artifact'
path: boot-disk.img
test-on-qemu:
test-exe-on-qemu:
needs: build-all-components
name: 'CI [i386] Run exe on QEMU'
runs-on: ubuntu-latest
Expand All @@ -97,11 +97,38 @@ jobs:
echo "::set-env name=VERSION::$pversion"
- name: 'Step 3: Install QEMU'
run: |
sudo apt-get update
sudo apt-get update
sudo apt-get install -yy qemu-system-i386
- name: 'Step 4: Dowmload artifact with exe image'
uses: actions/download-artifact@v2
with:
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
test-image-on-qemu:
needs: creating-qemu-image
name: 'CI [i386] Check virtual disk image'
runs-on: ubuntu-latest
continue-on-error: false
steps:
- name: 'Step 1: Checkout Repo'
uses: actions/[email protected]
with:
submodules: true
fetch-depth: 0
- name: 'Step 2: Make preparations'
run: |
./preparations.sh
pversion=$(bash ./ci/ci-generate-version.sh --arch ${{ env.RTEMS_ARCH }} --bsp ${{ env.RTEMS_BSP }} --branch ${{ github.head_ref }})
echo ${pversion}
echo "::set-env name=VERSION::$pversion"
- name: 'Step 3: Install QEMU'
run: |
sudo apt-get update
sudo apt-get install -yy qemu-system-i386
- name: 'Step 4: Dowmload artifact with QEMU disk image'
uses: actions/download-artifact@v2
with:
name: '${{ env.VERSION }}-boot-disk-img-artifact'
- name: 'Step 5: Test disk image on QEMU'
run: timeout 10 ./ci/ci-test-image-on-qemu.sh || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
8 changes: 8 additions & 0 deletions ci/ci-test-image-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}/*.img)
echo "Use ${filename} disk image file to test on QEMU"
qemu-system-i386 -m 128 -hda ${ROOT_DIR}/${filename} -M q35 -nographic

0 comments on commit d3140df

Please sign in to comment.