Run tests in qemu in GitHub action #111
Workflow file for this run
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: PR checks | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: shellcheck shell scripts | |
run: | | |
shellcheck scripts/build-in-container.sh | |
shellcheck scripts/build-release-artifacts.sh | |
shellcheck test/run_cicd_dos.sh | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/volkertb/debian-djgpp:v0.2 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Enforce Conventional Commits | |
uses: webiny/[email protected] | |
- name: Build project | |
run: | | |
make CC=gcc CXX=g++ | |
objdump -x output/sbemu.exe | |
- name: 'Upload test files' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sbemu-test-files | |
path: | | |
output/sbemu.exe | |
test/* | |
retention-days: 1 | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/volkertb/cicd-qemu-dos-docker:v1.8 | |
options: --device=/dev/kvm --cpus 1 | |
steps: | |
- name: 'Download test files' | |
uses: actions/download-artifact@v4 | |
with: | |
name: sbemu-test-files | |
- name: 'Download dependencies' | |
run: | | |
wget https://github.com/crazii/HX/releases/download/v0.1-beta3/HDPMI32i.zip | |
echo "4b7fc576d6c5dfd3fe7290fd1d0c0229118d01a55c8325d487452c2d6e0c3bbd HDPMI32i.zip" | sha256sum -c | |
unzip HDPMI32i.zip | |
- name: Test executable | |
run: | | |
ls -lh /dev/kvm | |
ls -lh . | |
echo "HDPMI32i.EXE" > CICD_DOS.BAT | |
echo "output\\sbemu" >> CICD_DOS.BAT | |
echo "cd test" >> CICD_DOS.BAT | |
echo "ren dos32a.exe dos4gw.exe" >> CICD_DOS.BAT | |
echo "ECHO Current BLASTER variable: %BLASTER%" >> CICD_DOS.BAT | |
echo "stp32 dtmf_src.wav a32sbdg.dll" >> CICD_DOS.BAT | |
cp -f test/run_cicd_dos.sh /usr/local/bin/ | |
chmod +x /usr/local/bin/run_cicd_dos.sh | |
/usr/local/bin/run_cicd_dos.sh | |
ls -lh |