-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (79 loc) · 2.71 KB
/
Copy pathbuild.yml
File metadata and controls
96 lines (79 loc) · 2.71 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
name: Build App
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: macos-15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Setup mise and Tuist
uses: jdx/mise-action@v2
- name: Prepare xcconfig files
run: |
mkdir -p Projects/App/Resources
if [ ! -f Projects/App/Resources/Common.xcconfig ]; then
printf 'BASE_URL = https:/$()/hellodoriworld.com\nKAKAO_NATIVE_APP_KEY =\n' > Projects/App/Resources/Common.xcconfig
fi
echo "✅ xcconfig file is ready"
- name: Install Tuist dependencies
run: tuist install
- name: Generate workspace
run: tuist generate --no-open
- name: Lint color assets
run: python3 Scripts/lint_color_assets.py
- name: Build project
run: |
xcodebuild \
-workspace Dori-iOS.xcworkspace \
-scheme DoriApp \
-configuration Debug \
-skipMacroValidation \
-destination "generic/platform=iOS Simulator" \
-jobs 1 \
SWIFT_ENABLE_EXPLICIT_MODULES=NO \
build
- name: Run unit tests (all *Tests schemes)
run: |
set -euo pipefail
TEST_SCHEMES="$(xcodebuild -workspace Dori-iOS.xcworkspace -list | awk '
/Schemes:/ { in_schemes=1; next }
in_schemes && NF {
gsub(/^[[:space:]]+|[[:space:]]+$/, "", $0)
print
}
' | grep 'Tests$' || true)"
if [ -z "${TEST_SCHEMES}" ]; then
echo "No *Tests schemes found. Skipping test step."
exit 0
fi
SIMULATOR_ID="$(xcrun simctl list devices available | awk -F '[()]' '
/iPhone/ && /(Shutdown|Booted)/ { print $2; exit }
')"
if [ -z "${SIMULATOR_ID}" ]; then
echo "No available iPhone simulator found."
exit 1
fi
echo "Using simulator id: ${SIMULATOR_ID}"
echo "Test schemes:"
echo "${TEST_SCHEMES}"
while IFS= read -r scheme; do
[ -z "${scheme}" ] && continue
echo "Running tests for scheme: ${scheme}"
xcodebuild \
-workspace Dori-iOS.xcworkspace \
-scheme "${scheme}" \
-configuration Debug \
-skipMacroValidation \
-destination "id=${SIMULATOR_ID}" \
-jobs 1 \
SWIFT_ENABLE_EXPLICIT_MODULES=NO \
test
done <<< "${TEST_SCHEMES}"