-
-
Notifications
You must be signed in to change notification settings - Fork 20
92 lines (87 loc) · 3.14 KB
/
Copy pathci.yml
File metadata and controls
92 lines (87 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Build + unit tests on every PR and on main. Pair with branch protection:
# Settings → Branches → Add rule for `main` → require this check, require PR.
# Do not pass CODE_SIGNING_ALLOWED=NO — macOS test bundles need ad-hoc signing to launch.
#
# Site-only pushes (changes exclusively under site/) skip the Xcode and SPM
# build steps but still complete green so the required "macos" check passes.
name: CI
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
macos:
# macOS 26 + Xcode 26 (e.g. SwiftUI `.glassEffect()`); macos-15 images only ship Xcode 16.x.
runs-on: macos-26
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Detect site-only change
id: paths
# On push: diff HEAD^ → HEAD. On PR or workflow_dispatch: always build.
run: |
if [ "${{ github.event_name }}" = "push" ]; then
BASE=$(git rev-parse HEAD^ 2>/dev/null || echo "")
if [ -n "$BASE" ] && ! git diff --name-only "$BASE" HEAD | grep -qvE '^site/'; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Build and test
if: steps.paths.outputs.skip != 'true'
run: |
set -eo pipefail
xcodebuild \
-project Dinky.xcodeproj \
-scheme Dinky \
-configuration Debug \
-destination 'platform=macOS' \
CODE_SIGN_IDENTITY=- \
CODE_SIGNING_REQUIRED=NO \
test
# Swift package: `dinky` CLI + DinkyCoreImage engine (local SPM, not bundled in the .app target).
spm:
runs-on: macos-26
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Detect site-only change
id: paths
run: |
if [ "${{ github.event_name }}" = "push" ]; then
BASE=$(git rev-parse HEAD^ 2>/dev/null || echo "")
if [ -n "$BASE" ] && ! git diff --name-only "$BASE" HEAD | grep -qvE '^site/'; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Install encoders for pipeline smoke tests
if: steps.paths.outputs.skip != 'true'
run: |
set -eo pipefail
brew install webp libavif oxipng
BIN="${RUNNER_TEMP:-/tmp}/dinky-encoders"
mkdir -p "$BIN"
ln -sf "$(brew --prefix webp)/bin/cwebp" "$BIN/cwebp"
ln -sf "$(brew --prefix libavif)/bin/avifenc" "$BIN/avifenc"
ln -sf "$(brew --prefix oxipng)/bin/oxipng" "$BIN/oxipng"
echo "DINKY_BIN=$BIN" >> "$GITHUB_ENV"
- name: Swift build and test (DinkyCoreImage)
if: steps.paths.outputs.skip != 'true'
run: |
set -eo pipefail
cd DinkyCoreImage
swift build -c debug
swift test