-
Notifications
You must be signed in to change notification settings - Fork 1
145 lines (119 loc) · 4.17 KB
/
Copy pathci.yml
File metadata and controls
145 lines (119 loc) · 4.17 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on:
pull_request:
branches:
- main
merge_group:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install SwiftLint
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: brew install swiftlint
- name: Run SwiftLint
run: swiftlint lint --strict --reporter github-actions-logging
macos-build-and-test:
name: macOS Build + Test
needs: lint
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Write CI build settings override
env:
SPARKLE_APPCAST_URL: ${{ vars.SPARKLE_APPCAST_URL }}
SPARKLE_PUBLIC_KEY: ${{ vars.SPARKLE_PUBLIC_KEY }}
run: |
if [[ -z "${SPARKLE_APPCAST_URL:-}" ]]; then
echo "Missing required repository variable: SPARKLE_APPCAST_URL"
exit 1
fi
if [[ -z "${SPARKLE_PUBLIC_KEY:-}" ]]; then
echo "Missing required repository variable: SPARKLE_PUBLIC_KEY"
exit 1
fi
cat > Config/BuildSettings.local.xcconfig <<EOF
SPARKLE_APPCAST_URL = $SPARKLE_APPCAST_URL
SPARKLE_PUBLIC_KEY = $SPARKLE_PUBLIC_KEY
EOF
- name: Build and test app (macOS)
run: |
RESULT_BUNDLE="$RUNNER_TEMP/BitDream.xcresult"
rm -rf "$RESULT_BUNDLE"
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild test \
-project BitDream.xcodeproj \
-scheme BitDream \
-configuration Debug \
-destination "platform=macOS,arch=arm64" \
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
-resultBundlePath "$RESULT_BUNDLE" \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO
- name: Print macOS test failure summary
if: failure()
run: |
RESULT_BUNDLE="$RUNNER_TEMP/BitDream.xcresult"
if [[ ! -d "$RESULT_BUNDLE" ]]; then
echo "No xcresult bundle found at $RESULT_BUNDLE"
exit 0
fi
echo "::group::macOS test summary"
xcrun xcresulttool get test-results summary --path "$RESULT_BUNDLE" --compact || true
echo "::endgroup::"
echo "::group::macOS test results"
xcrun xcresulttool get test-results tests --path "$RESULT_BUNDLE" --compact || true
echo "::endgroup::"
echo "::group::macOS build results"
xcrun xcresulttool get build-results --path "$RESULT_BUNDLE" --compact || true
echo "::endgroup::"
- name: Upload macOS xcresult bundle
if: failure()
uses: actions/upload-artifact@v4
with:
name: macos-xcresult
path: ${{ runner.temp }}/BitDream.xcresult
if-no-files-found: ignore
ios-build:
name: iOS Build
needs: lint
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Write CI build settings override
env:
SPARKLE_APPCAST_URL: ${{ vars.SPARKLE_APPCAST_URL }}
SPARKLE_PUBLIC_KEY: ${{ vars.SPARKLE_PUBLIC_KEY }}
run: |
if [[ -z "${SPARKLE_APPCAST_URL:-}" ]]; then
echo "Missing required repository variable: SPARKLE_APPCAST_URL"
exit 1
fi
if [[ -z "${SPARKLE_PUBLIC_KEY:-}" ]]; then
echo "Missing required repository variable: SPARKLE_PUBLIC_KEY"
exit 1
fi
cat > Config/BuildSettings.local.xcconfig <<EOF
SPARKLE_APPCAST_URL = $SPARKLE_APPCAST_URL
SPARKLE_PUBLIC_KEY = $SPARKLE_PUBLIC_KEY
EOF
- name: Build app (iOS)
run: |
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build \
-project BitDream.xcodeproj \
-scheme BitDream \
-configuration Debug \
-destination "generic/platform=iOS" \
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO