Files
gui/.github/workflows/build.yml
T
Claude f354ab01d0 Build the Windows app for Linux and macOS over clang-retro MFC's Win32 layer
First pass: TCP and SSH. With -DDMODEM_GUI_WINPORT=ON and CLANG_RETRO_MFC
set to a clang-retro MFC checkout, winport/ builds libwinport.a with the
MFC Makefile, converts app.rc with res2cpp.py, and links the same Win32
sources (now listed once, in windows/sources.cmake) as dmodem-win32.

The layer does not have serial ports, pipes or audio yet: winport/include
and winport/src/stubs.cpp supply stand-ins that fail, to remove when the
layer gets these functions. DMODEM_WINPORT blocks in the app: the settings
in ~/.config/D-Modem, TCP as the default line, ~/.ssh and '/' for SSH,
Unicode marks in the path view (no Wingdings), and group boxes put under
the other controls (the layer's hit test stops at HTTRANSPARENT).

CI builds it on Linux and macOS, and on Linux starts it in Xvfb against
a test modem on the TCP port (winport/test/smoke.sh).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRhKGCaYUyYtH7Boap
2026-11-20 13:58:32 +00:00

199 lines
7.6 KiB
YAML

# Builds and tests the three apps and the library they share, and the
# Windows app for Linux and macOS (winport/)
name: Build
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
linux:
name: Linux (GTK 4)
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 libgtk-4-dev libadwaita-1-dev \
libpulse-dev libsndfile1-dev
- 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 (clang-retro, win32-picolibc)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- 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
- uses: actions/upload-artifact@v4
with:
name: dmodem-windows-9x
path: build/win9x/windows/dmodem.exe
windows:
name: Windows 7 and later (clang-retro)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- 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. First pass: TCP and SSH only.
winport-linux:
name: Windows app on Linux (clang-retro MFC's Win32 layer)
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: clang-retro/mfc
path: mfc
- name: Packages
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake ninja-build clang llvm libx11-dev xvfb xauth
- name: Build
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DDMODEM_GUI_LINUX=OFF -DDMODEM_GUI_WINPORT=ON -DCLANG_RETRO_MFC="$PWD/mfc" \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build --target dmodem-win32
- name: Smoke test (Xvfb)
run: xvfb-run -a winport/test/smoke.sh build/winport/dmodem-win32
- uses: actions/upload-artifact@v4
with:
name: dmodem-win32-linux
path: build/winport/dmodem-win32
winport-macos:
name: Windows app on macOS (clang-retro MFC's Win32 layer)
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: clang-retro/mfc
path: mfc
- 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_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake --build build --target dmodem-win32 -j"$(sysctl -n hw.ncpu)"
- uses: actions/upload-artifact@v4
with:
name: dmodem-win32-macos
path: build/winport/dmodem-win32
macos:
name: macOS (SwiftUI)
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Library tests
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0
cmake --build build
ctest --test-dir build --output-on-failure
- name: Project
run: |
brew install xcodegen
cd macos && xcodegen
- name: Build
run: |
cd macos
xcodebuild -project DModem.xcodeproj -scheme DModem \
-configuration Release -derivedDataPath ../build/xcode \
CODE_SIGN_IDENTITY=- build
- uses: actions/upload-artifact@v4
with:
name: dmodem-macos
path: build/xcode/Build/Products/Release/D-Modem.app