diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 53eadc2f..28cb3cdf 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -3,7 +3,6 @@ on: pull_request: types: - opened - - edited - ready_for_review - reopened - synchronize @@ -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: @@ -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 @@ -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_* diff --git a/ci_prereq.sh b/ci_prereq.sh index 0258bc8f..3a245e71 100755 --- a/ci_prereq.sh +++ b/ci_prereq.sh @@ -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 diff --git a/ci_setup_test.sh b/ci_setup_test.sh deleted file mode 100755 index 7bd21d4a..00000000 --- a/ci_setup_test.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh - -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 https://github.com/dosemu2/dosemu2.git ${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 ppa:stsp-0/dj64 - sudo add-apt-repository -y ppa:dosemu2/ppa - 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 ppa:dosemu2/ppa - sudo add-apt-repository -y ppa:jwt27/djgpp-toolchain - sudo add-apt-repository -y ppa:stsp-0/gcc-ia16 - sudo apt update -q - - sudo apt install -y \ - 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 - - # Prepare the cputests - make -C test/cpu clean all - - # Get the test binaries - test/test_dosemu.py --get-test-binaries -) diff --git a/ci_test.sh b/ci_test.sh index 6548053c..9110759a 100755 --- a/ci_test.sh +++ b/ci_test.sh @@ -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 @@ -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 ) diff --git a/ci_test_prereq.sh b/ci_test_prereq.sh index c416716e..65b8fa02 100755 --- a/ci_test_prereq.sh +++ b/ci_test_prereq.sh @@ -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 +)