Skip to content
Draft

Ci 60 #303

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 47 additions & 4 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
pull_request:
types:
- opened
- edited
- ready_for_review
- reopened
- synchronize
Expand All @@ -12,6 +11,7 @@ on:
env:
DIR_TEST_DOSEMU: test-dosemu
DIR_INSTALLED_FDPP: test-dosemu/installed-fdpp
USE_DOSEMU_REPO: https://github.com/dosemu2/dosemu2.git
USE_DOSEMU_BRANCH: devel

jobs:
Expand All @@ -20,10 +20,40 @@ jobs:

if: contains(github.event.head_commit.message, '[skip ci]') == false

runs-on: ubuntu-24.04
runs-on: ubuntu-26.04

steps:
- uses: actions/checkout@v6
- name: Checkout
uses: actions/checkout@v6

- name: Add an ACL to KVM for ourselves
run: |
echo 'SUBSYSTEM=="misc", KERNEL=="kvm", RUN+="/usr/bin/setfacl -m u:'${USER}':rw- /dev/kvm"' | sudo tee /etc/udev/rules.d/99-kvm4dosemu2.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Information
run: |
#
echo "::group::CPU"
lscpu
echo "::endgroup::"

echo "::group::Kernel Config"
cat /boot/config-$(uname -r)
echo "::endgroup::"

echo "::group::Kernel Modules"
sudo lsmod
echo "::endgroup::"

echo "::group::Kernel Parameters (sysctl)"
sysctl -a
echo "::endgroup::"

echo "::group::KVM permissions"
getfacl -p /dev/kvm
echo "::endgroup::"

- name: Package install
run: ./ci_prereq.sh
Expand All @@ -32,7 +62,20 @@ jobs:
run: ./ci_build.sh

- name: Set up test environment
run: ./ci_setup_test.sh
run: ./ci_test_prereq.sh

- name: Open Watcom install
uses: open-watcom/setup-watcom@v1
with:
version: 2.0-64

- name: Test
id: test
run: ./ci_test.sh

- name: Upload failure logs
if: ${{ always() && (steps.test.outcome == 'failure') }}
uses: actions/upload-artifact@v6
with:
name: failure-logs
path: ${{ env.DIR_TEST_DOSEMU }}/test_*
2 changes: 1 addition & 1 deletion ci_prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ sudo apt install -y \
git \
clang

sudo add-apt-repository ppa:stsp-0/thunk-gen
sudo add-apt-repository -y ppa:stsp-0/thunk-gen
mk-build-deps --install --root-cmd sudo
87 changes: 0 additions & 87 deletions ci_setup_test.sh

This file was deleted.

16 changes: 14 additions & 2 deletions ci_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -e

. ./ci_test_prereq.sh

if [ -z "${DIR_TEST_DOSEMU}" ] ; then
echo env var "DIR_TEST_DOSEMU" is empty or missing
exit 1
Expand All @@ -21,6 +19,20 @@ DIR_ROOT="$(pwd)"

# Now do the tests
export LD_LIBRARY_PATH=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/lib/fdpp
export PYTHONUNBUFFERED=1
export SKIP_EXPENSIVE=1

cat >&2 << EOF
===============================================================
= Processor tests run on emulated CPU, KVM and VM86 =
===============================================================
EOF
env NO_FAILFAST=1 python3 test/test_processor.py

cat >&2 << EOF2
===============================================================
= Other tests run on KVM =
===============================================================
EOF2
test/test_dosemu.py PPDOSGITTestCase
)
96 changes: 93 additions & 3 deletions ci_test_prereq.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,96 @@
#!/bin/sh

sudo apt update -q
sudo apt install -y \
set -e

if [ -z "${DIR_TEST_DOSEMU}" ] ; then
echo env var "DIR_TEST_DOSEMU" is empty or missing
exit 1
fi

if [ -z "${DIR_INSTALLED_FDPP}" ] ; then
echo env var "DIR_INSTALLED_FDPP" is empty or missing
exit 1
fi

test -d ${DIR_TEST_DOSEMU} && (echo $DIR_TEST_DOSEMU already exists && exit 1)

DIR_ROOT="$(pwd)"

# Grab the dosemu2 source
git clone --depth 1 --no-single-branch ${USE_DOSEMU_REPO} ${DIR_TEST_DOSEMU}

# Install fdpp into local directory
if false ; then
make install prefix="${DIR_ROOT}/${DIR_INSTALLED_FDPP}"
else
meson install -C ${DIR_ROOT}/build
fi

(
cd ${DIR_TEST_DOSEMU} || exit 2
[ -z "${USE_DOSEMU_BRANCH}" ] || git checkout "${USE_DOSEMU_BRANCH}"

# Remove fdpp-dev from debian build dependencies (use bash as padding)
sed -i -e 's/fdpp-dev,/bash,/' debian/control

# Use debian package build deps so we don't have to maintain a list here
sudo add-apt-repository -y --no-update ppa:stsp-0/dj64
sudo add-apt-repository -y --no-update ppa:dosemu2/ppa
sudo apt update -q

mk-build-deps --install --root-cmd sudo

CC=clang ./default-configure -d \
--prefix=${DIR_ROOT}/${DIR_INSTALLED_FDPP} \
--with-fdpp-lib-dir=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/lib \
--with-fdpp-include-dir=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/include \
--with-fdpp-pkgconf-dir=${DIR_ROOT}/${DIR_INSTALLED_FDPP}/lib/pkgconfig
make

# Install the FAT mount helper
sudo cp test/dosemu_fat_mount.sh /bin/.
sudo chown root:root /bin/dosemu_fat_mount.sh
sudo chmod 755 /bin/dosemu_fat_mount.sh

# Install the TAP helper
sudo cp test/dosemu_tap_interface.sh /bin/.
sudo chown root:root /bin/dosemu_tap_interface.sh
sudo chmod 755 /bin/dosemu_tap_interface.sh

# Install the extra packages needed to run the test suite
sudo add-apt-repository -y --no-update ppa:dosemu2/ppa

# Install djgpp and ia16 compilers / libs.
sudo add-apt-repository -y --no-update ppa:jwt27/djgpp-toolchain
sudo add-apt-repository -y --no-update ppa:stsp-0/gcc-ia16
is_amd64v3=$(apt-config dump | grep -q 'Variants.*amd64v3' && echo true || echo false) # APT::Architecture-Variants "amd64v3"
if [ "$is_amd64v3" = "true" ] ; then
# Since there are no host libs to link against we can use amd64 arch on arm64v3
sudo sed -i '/^URIs:/i Architectures: amd64' /etc/apt/sources.list.d/jwt27-ubuntu-djgpp-toolchain-resolute.sources
sudo sed -i '/^URIs:/i Architectures: amd64' /etc/apt/sources.list.d/stsp-0-ubuntu-gcc-ia16-resolute.sources
fi
sudo apt update -q

sudo apt install -y \
diffutils \
gdb
gdb \
comcom64 \
python3-cpuinfo \
python3-pexpect \
mtools \
gcc-djgpp \
djgpp-dev \
qemu-system-common \
gcc-ia16-elf \
libi86-ia16-elf \
libi86-testsuite-ia16-elf \
nasm \
gcc-multilib \
dos2unix \
bridge-utils \
libvirt-daemon \
libvirt-daemon-system

# Get the test binaries
test/test_dosemu.py --get-test-binaries
)