Files
gui/.github/workflows/build.yml
T
Neo-DesktopandClaude Opus 5.5 d924bf8860 Make the Win32 app the only desktop GUI
Remove the SwiftUI app for macOS (macos/, cmake/MacosEmbed.cmake,
cmake/macos-embed/) and the GTK 4 app for Linux (linux/). The Win32
app (windows/) is now the canonical GUI on Windows, and on Linux and
macOS over the portable Win32 layer of clang-retro MFC (winport/).

- CMake: remove DMODEM_GUI_LINUX and the Xcode support. With no
  DMODEM_GUI_WINPORT, Linux and macOS build only the libraries and
  their tests. The built-in modem is on by default for Windows and
  winport.
- winport: install the app, its desktop entry, AppStream data, icon
  and the MT9234MU firmware on Linux (firmware/ moves to the top).
- CI: the "core" job keeps the library, sanitizer and sshd tests on
  Linux. The macOS library tests move to the winport-macos job. The
  linux and macos jobs and their nightly files are removed.
- Docs, site and comments: describe one Win32 app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUx6MjNXmAFKULZu3U
Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
2026-11-28 12:48:14 +00:00

252 lines
10 KiB
YAML

# Builds and tests the app (windows/) and the library that it uses
# (core/, ssh/): on Windows 95 to Windows 11, and on Linux and macOS over
# clang-retro MFC's portable Win32 layer (winport/)
name: Build
# The nightly release (nightly.yml) takes its files from this
# workflow's artifacts on main. Each artifact is a .tar.gz or a .zip,
# because an artifact does not keep the executable bit of a file.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
# libdmodemctl (core/) and libdmodemssh (ssh/), with no app: the
# tests, the tests with the sanitizers, and SSH against a real sshd
core:
name: Library and SSH tests (Linux)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake ninja-build pkg-config
- name: Build
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Test with the sanitizers
run: |
cmake -S . -B build-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all"
cmake --build build-asan --target dmodemctl_test
ctest --test-dir build-asan --output-on-failure -R dmodemctl
- name: SSH against a real sshd
run: |
sudo apt-get install -y --no-install-recommends openssh-server putty-tools
sudo useradd -m dmtest
echo 'dmtest:Sesame-42' | sudo chpasswd
# a key in a file, one of PuTTY's (.ppk) and one in an agent
ssh-keygen -q -t ed25519 -N '' -f "$RUNNER_TEMP/key"
: > "$RUNNER_TEMP/empty"
puttygen -t rsa -b 2048 -o "$RUNNER_TEMP/key.ppk" --new-passphrase "$RUNNER_TEMP/empty"
ssh-keygen -q -t ecdsa -N '' -f "$RUNNER_TEMP/agentkey"
eval "$(ssh-agent -a "$RUNNER_TEMP/agent.sock")"
ssh-add "$RUNNER_TEMP/agentkey"
unset SSH_AUTH_SOCK
puttygen "$RUNNER_TEMP/key.ppk" -O public-openssh -o "$RUNNER_TEMP/ppk.pub"
cat "$RUNNER_TEMP/key.pub" "$RUNNER_TEMP/agentkey.pub" "$RUNNER_TEMP/ppk.pub" > "$RUNNER_TEMP/authorized_keys"
sudo install -d -m 700 -o dmtest ~dmtest/.ssh
sudo install -m 600 -o dmtest "$RUNNER_TEMP/authorized_keys" ~dmtest/.ssh/authorized_keys
sudo mkdir -p /run/sshd
sudo /usr/sbin/sshd -p 2222 -o ListenAddress=127.0.0.1 -o PasswordAuthentication=yes
DMODEM_SSH_TEST=127.0.0.1:2222:dmtest:Sesame-42 DMODEM_SSH_TEST_KEY="$RUNNER_TEMP/key" \
DMODEM_SSH_TEST_PPK="$RUNNER_TEMP/key.ppk" DMODEM_SSH_TEST_AGENT="$RUNNER_TEMP/agent.sock" \
build/ssh/dmodemssh_test
# Both Windows builds use clang-retro (https://clang-retro.github.io/),
# its toolchain package from its setup-toolchain action, on Linux
windows-9x:
name: Windows 95 and later, the modem built in (clang-retro, win32-picolibc)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: clang-retro/dos-sdk/.github/actions/setup-toolchain@main
id: clang-dos
- name: Packages
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends ninja-build wine wine32:i386
- name: Build
run: |
cmake -S . -B build/win9x -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=cmake/clang-retro.cmake -DCLANG_RETRO_CONFIG=win32-picolibc \
-DCMAKE_CROSSCOMPILING_EMULATOR=wine
cmake --build build/win9x
- name: Test (Wine)
run: |
export WINEDEBUG=-all WINEPREFIX="$RUNNER_TEMP/wine"
wineboot -i >/dev/null 2>&1 || true
ctest --test-dir build/win9x --output-on-failure
- name: Imports (Windows 95, 98 and ME, and NT 4.0)
run: |
python3 "$CLANG_DOS/share/clang-dos/check-imports.py" build/win9x/windows/dmodem.exe
python3 "$CLANG_DOS/share/clang-dos/check-imports.py" --nt 4.0 build/win9x/windows/dmodem.exe
# (no iphlpapi.dll, which Windows 95 does not have, and no msvcrt.dll)
if "$CLANG_DOS/bin/llvm-objdump" -p build/win9x/windows/dmodem.exe |
grep -i "DLL Name: \(msvcrt\|iphlpapi\)"; then
exit 1
fi
"$CLANG_DOS/bin/llvm-nm" build/win9x/windows/dmodem.exe | grep -q dmodem_embed_start
- uses: actions/upload-artifact@v4
with:
name: dmodem-windows-9x
path: build/win9x/windows/dmodem.exe
# The app with the modem built in (external/D-Modem), on msvcrt:
# Windows 98 SE, ME, 2000 and later. (The Windows 95 build above has
# the modem too, on picolibc and libc++.)
windows-98:
name: Windows 98 SE and later, the modem built in (clang-retro, win98)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: clang-retro/dos-sdk/.github/actions/setup-toolchain@main
id: clang-dos
- name: Packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ninja-build
- name: Build
run: |
cmake -S . -B build/win98 -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=cmake/clang-retro.cmake -DCLANG_RETRO_CONFIG=win98
cmake --build build/win98
- name: Imports (Windows 98 SE)
run: python3 "$CLANG_DOS/share/clang-dos/check-imports.py" build/win98/windows/dmodem.exe
- uses: actions/upload-artifact@v4
with:
name: dmodem-windows-98
path: build/win98/windows/dmodem.exe
windows:
name: Windows 7 and later (clang-retro)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: clang-retro/dos-sdk/.github/actions/setup-toolchain@main
id: clang-dos
- name: Packages
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends ninja-build wine wine32:i386
- name: Build
run: |
cmake -S . -B build/win7 -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=cmake/clang-retro.cmake -DCLANG_RETRO_CONFIG=win7 \
-DCMAKE_CROSSCOMPILING_EMULATOR=wine
cmake --build build/win7
- name: Test (Wine)
run: |
export WINEDEBUG=-all WINEPREFIX="$RUNNER_TEMP/wine"
wineboot -i >/dev/null 2>&1 || true
ctest --test-dir build/win7 --output-on-failure
- uses: actions/upload-artifact@v4
with:
name: dmodem-windows
path: build/win7/windows/dmodem.exe
# The Windows app for Linux and macOS (winport/), over the portable
# Win32 layer of clang-retro MFC, with the modem built in
# (external/D-Modem)
winport-linux:
name: Windows app on Linux, the modem built in (clang-retro MFC's Win32 layer)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/checkout@v4
with:
repository: clang-retro/mfc
path: mfc
submodules: recursive
- name: Packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake ninja-build clang llvm libx11-dev xvfb xauth \
libusb-1.0-0-dev libasound2-dev
- name: Build
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DDMODEM_GUI_WINPORT=ON -DCLANG_RETRO_MFC="$PWD/mfc" \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build --target dmodem-win32
- name: The built-in modem is in the app
run: nm build/winport/dmodem-win32 | grep -q dmodem_embed_start
- name: Smoke test (Xvfb)
run: xvfb-run -a winport/test/smoke.sh build/winport/dmodem-win32
- name: Package
run: tar -C build/winport -czf dmodem-win32-linux-x86_64.tar.gz dmodem-win32
- uses: actions/upload-artifact@v4
with:
name: dmodem-win32-linux
path: dmodem-win32-linux-x86_64.tar.gz
# arm64 for a Mac with Apple silicon, and x86_64 for an Intel Mac. The
# runner has Apple silicon: it builds the x86_64 app with
# CMAKE_OSX_ARCHITECTURES=x86_64 (winport/CMakeLists.txt).
winport-macos:
name: Windows app on macOS (${{ matrix.arch }}), the modem built in (clang-retro MFC's Win32 layer)
runs-on: macos-15
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
artifact: dmodem-win32-macos
- arch: x86_64
artifact: dmodem-win32-macos-x86_64
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/checkout@v4
with:
repository: clang-retro/mfc
path: mfc
submodules: recursive
- name: Packages
run: brew install llvm
- name: Build
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DDMODEM_GUI_WINPORT=ON -DCLANG_RETRO_MFC="$PWD/mfc" \
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build --target dmodem-win32 -j"$(sysctl -n hw.ncpu)"
- name: The app is for ${{ matrix.arch }} only
run: |
lipo -archs build/winport/dmodem-win32
test "$(lipo -archs build/winport/dmodem-win32)" = "${{ matrix.arch }}"
- name: The built-in modem is in the app
run: nm build/winport/dmodem-win32 | grep -q dmodem_embed_start
- name: Library tests
run: |
cmake --build build --target dmodemctl_test xfer_test -j"$(sysctl -n hw.ncpu)"
ctest --test-dir build --output-on-failure -R '^(dmodemctl|xfer)$'
- name: Package
run: tar -C build/winport -czf dmodem-win32-macos-${{ matrix.arch }}.tar.gz dmodem-win32
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: dmodem-win32-macos-${{ matrix.arch }}.tar.gz