Files
OpenStats/.github/workflows/ci.yml
T

56 lines
1.8 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
jobs:
build-and-test:
runs-on: macos-15
steps:
- uses: actions/checkout@v7
# CommandLineTools alone cannot expand SwiftUI's @Observable / @Entry
# macros — the plugins ship only with full Xcode. Liquid Glass needs the
# macOS 26 SDK, so pick the newest Xcode on the image rather than the
# default one or a pinned version that a future image may not carry.
- name: Select Xcode
run: |
ls -d /Applications/Xcode*.app
XCODE=$(ls -d /Applications/Xcode_*.app | sort -V | tail -1)
echo "Using $XCODE"
sudo xcode-select -s "$XCODE/Contents/Developer"
swift --version
- name: Install XcodeGen
run: brew install xcodegen
- name: Test
run: make test
- name: Build app
run: make build CONFIG=Release
- name: Verify bundle
run: |
APP=build/DerivedData/Build/Products/Release/OpenStats.app
test -x "$APP/Contents/MacOS/OpenStats"
test -x "$APP/Contents/MacOS/OpenStatsHelper"
test -f "$APP/Contents/Library/LaunchDaemons/com.openstats.helper.plist"
test -f "$APP/Contents/Resources/AppIcon.icns"
codesign --verify --verbose "$APP"
# Smoke test: the panel is a menu-bar popover with no window to drive in
# CI, so render it off-screen instead. A view that traps on layout fails
# here rather than the first time a user clicks the menu-bar item.
- name: Render UI snapshots
run: |
build/DerivedData/Build/Products/Release/OpenStats.app/Contents/MacOS/OpenStats --snapshot "$PWD/snapshots"
test "$(ls snapshots/*.png | wc -l)" -ge 20
- uses: actions/upload-artifact@v7
with:
name: ui-snapshots
path: snapshots/