- 菜单栏可每项独立(点击弹出该项窄详情)或合并为一个(点击打开主窗口),详情区块可在设置中勾选 - 网络详情:镜像流量历史、ICMP 连接探测格子、接口与 Wi-Fi、本地与公网 IPv4 / IPv6、SVG 国旗归属地与 ASN、各进程流量 - DNS:刷新缓存,一键切换自动 / Cloudflare / Google / 腾讯 / 阿里云或手动填写;辅助工具协议升至 3,服务名与地址二次校验 - 主窗口:侧边栏切换仪表盘、各指标详情与工具页,宽高可调,卡片按比例伸缩 - 统一外观:白底蓝 / 黑底蓝,窗口、设置与弹窗共用底色,去掉玻璃效果 - 新增网络解析、DNS 校验与国旗代码校验的单元测试;更新 README、架构文档与隐私说明
56 lines
1.8 KiB
YAML
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. 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: there is no menu bar or window to drive in CI, so render
|
|
# every main-window page, popover and settings section off-screen. A view
|
|
# that traps on layout fails here rather than the first time a user opens it.
|
|
- 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/
|