Skip to content

Move test files to src/test/ directory #70

Move test files to src/test/ directory

Move test files to src/test/ directory #70

name: Classic Mac OS 7 Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
workflow_call:
outputs:
version:
description: "Version string for the build"
value: ${{ jobs.build.outputs.version }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
xvfb \
xdotool \
hfsutils \
x11-utils \
scrot \
imagemagick \
libx11-dev \
libxext-dev \
unar
- name: Validate macsrc sync with disk image
run: |
cd macsrc
./doit.sh
cd ..
if [ -n "$(git status --porcelain)" ]; then
echo "ERROR: macsrc/ is not in sync with MacFlim Source Code.dsk"
echo "Run 'macsrc/doit.sh' locally and commit the changes."
git status
git diff
exit 1
fi
echo "✓ macsrc/ is in sync with disk image"
- name: Build Mini vMac from source
run: |
git clone --depth 1 https://github.com/fstark/minivmac.git minivmac-src
cd minivmac-src
gcc setup/tool.c -o setup_t
./setup_t -m IIx -mem 8M -t lx64 -hres 512 -vres 342 -speed a -magnify 0 -depth 0 > setup.sh
bash setup.sh
make
cp minivmac ../release/minivmac
cp MacIIx.ROM ../release/MacIIx.ROM
chmod +x ../release/minivmac
cd ..
- name: Build sit and macunpack tools
run: |
# Build sit tool
git clone --depth 1 https://github.com/fstark/sit.git sit-src
cd sit-src
make
cp sit ../release/sit
chmod +x ../release/sit
cd ..
# Build macunpack tool
git clone --depth 1 https://github.com/fstark/macutils.git macutils-src
cd macutils-src/macunpack
make
cp macunpack ../../release/macunpack
chmod +x ../../release/macunpack
cd ../..
# Verify tools are available
./release/sit --version || echo "sit tool ready"
./release/macunpack --version || echo "macunpack tool ready"
- name: Extract version
id: version
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
else
VERSION=dev-$(git rev-parse --short HEAD)
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Building version: $VERSION"
- name: Build MacFlim with Xvfb
working-directory: release
run: |
# Start Xvfb
Xvfb :99 -screen 0 1280x1024x24 &
export DISPLAY=:99
sleep 2
# Add tools to PATH
export PATH="$PWD:$PATH"
# Run build (minivmac is now in release/ directory)
MINIVMAC=./minivmac bash cicd.sh
timeout-minutes: 10
- name: Upload debug screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: debug-screenshots-${{ github.run_id }}
path: release/debug-*.png
if-no-files-found: warn
- name: Capture debug info on failure
if: failure()
run: |
export DISPLAY=:99
mkdir -p debug
scrot debug/screen.png || true
xwininfo -root -tree > debug/windows.txt || true
ps aux | grep minivmac > debug/processes.txt || true
echo "Debug artifacts captured"
- name: Upload debug artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: debug-${{ github.run_id }}
path: debug/
retention-days: 30
- name: Upload release disk artifact
uses: actions/upload-artifact@v4
with:
name: MacFlim-${{ env.VERSION }}-Release-dsk
path: release/MacFlim v${{ env.VERSION }}.dsk
retention-days: 90
- name: Upload StuffIt archive artifact
uses: actions/upload-artifact@v4
with:
name: MacFlim-${{ env.VERSION }}-Release-sit
path: release/MacFlim v${{ env.VERSION }}.sit
retention-days: 90