Skip to content

Commit 03ad365

Browse files
more fixes
1 parent cb30cbe commit 03ad365

File tree

4 files changed

+30
-19
lines changed

4 files changed

+30
-19
lines changed

.github/actions/xcode-setup/action.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: 'Setup Xcode Test Environment'
22
description: 'Common setup steps for Xcode tests'
33

44
inputs:
5-
node_version:
6-
description: 'Node.js version to use'
7-
required: true
85
xcode_version:
96
description: 'Xcode version to use'
107
required: true
@@ -18,7 +15,7 @@ runs:
1815
steps:
1916
- uses: actions/setup-node@v6
2017
with:
21-
node-version: ${{ inputs.node_version }}
18+
node-version: lts/*
2219
- uses: maxim-lobanov/setup-xcode@v1
2320
with:
2421
xcode-version: ${{ inputs.xcode_version }}

.github/workflows/wda-tests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ env:
2121
MAX_IPHONE_DEVICE_NAME: "iPhone 17"
2222
MAX_TV_DEVICE_NAME: "Apple TV 4K (3rd generation)"
2323
MAX_IPAD_DEVICE_NAME: "iPad Air 11-inch (M2)"
24-
DEFAULT_NODE_VERSION: "22.x"
2524

2625
jobs:
2726
build_matrix:
@@ -118,7 +117,6 @@ jobs:
118117
- uses: actions/checkout@v6
119118
- uses: ./.github/actions/xcode-setup
120119
with:
121-
node_version: ${{ env.DEFAULT_NODE_VERSION }}
122120
xcode_version: ${{ matrix.config.xcode_version }}
123121
- name: Build
124122
run: ./Scripts/build.sh
@@ -146,7 +144,6 @@ jobs:
146144
- uses: actions/checkout@v6
147145
- uses: ./.github/actions/xcode-setup
148146
with:
149-
node_version: ${{ env.DEFAULT_NODE_VERSION }}
150147
xcode_version: ${{ matrix.config.xcode_version }}
151148
- name: Analyze
152149
run: ./Scripts/build.sh
@@ -172,7 +169,6 @@ jobs:
172169
- uses: actions/checkout@v6
173170
- uses: ./.github/actions/xcode-setup
174171
with:
175-
node_version: ${{ env.DEFAULT_NODE_VERSION }}
176172
xcode_version: ${{ matrix.config.xcode_version }}
177173
- name: Run unit tests
178174
run: ./Scripts/build.sh
@@ -197,7 +193,6 @@ jobs:
197193
- uses: actions/checkout@v6
198194
- uses: ./.github/actions/xcode-setup
199195
with:
200-
node_version: ${{ env.DEFAULT_NODE_VERSION }}
201196
xcode_version: ${{ matrix.config.xcode_version }}
202197
- name: Start iOS Simulator UI
203198
run: open -Fn "$(xcode-select --print-path)/Applications/Simulator.app"

Fastlane/Fastfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ lane :test do
77
fail_build: true,
88
scheme: ENV['SCHEME'],
99
sdk: ENV['SDK'],
10-
destination: ENV['DEST'],
10+
device: ENV['DEVICE'],
11+
os_version: ENV['OS_VERSION'],
1112
number_of_retries: 3
1213
)
1314
end

Scripts/build.sh

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function define_xc_macros() {
2121
esac
2222

2323
case "${DEST:-}" in
24-
"iphone" ) XC_DESTINATION="name=`echo $IPHONE_MODEL | tr -d "'"`,OS=$IOS_VERSION";;
25-
"ipad" ) XC_DESTINATION="name=`echo $IPAD_MODEL | tr -d "'"`,OS=$IOS_VERSION";;
26-
"tv" ) XC_DESTINATION="name=`echo $TV_MODEL | tr -d "'"`,OS=$TV_VERSION";;
24+
"iphone" ) XC_DESTINATION="platform=iOS Simulator,name=`echo $IPHONE_MODEL | tr -d "'"`,OS=$IOS_VERSION";;
25+
"ipad" ) XC_DESTINATION="platform=iOS Simulator,name=`echo $IPAD_MODEL | tr -d "'"`,OS=$IOS_VERSION";;
26+
"tv" ) XC_DESTINATION="platform=tvOS Simulator,name=`echo $TV_MODEL | tr -d "'"`,OS=$TV_VERSION";;
2727
"generic" ) XC_DESTINATION="generic/platform=iOS";;
2828
"tv_generic" ) XC_DESTINATION="generic/platform=tvOS" XC_MACROS="${XC_MACROS} ARCHS=arm64";; # tvOS only supports arm64
2929
esac
@@ -85,13 +85,31 @@ function xcbuild() {
8585
}
8686

8787
function fastlane_test() {
88-
bundle install
89-
90-
if [[ -n "$XC_DESTINATION" ]]; then
91-
SDK="$XC_SDK" DEST="$XC_DESTINATION" SCHEME="$1" bundle exec fastlane test
92-
else
93-
SDK="$XC_SDK" SCHEME="$1" bundle exec fastlane test
88+
# Skip bundle install if already installed (CI already does this)
89+
if ! bundle check &>/dev/null; then
90+
bundle install
9491
fi
92+
93+
case "${DEST:-}" in
94+
"iphone" )
95+
FASTLANE_DEVICE=$(echo $IPHONE_MODEL | tr -d "'")
96+
FASTLANE_OS_VERSION="$IOS_VERSION"
97+
;;
98+
"ipad" )
99+
FASTLANE_DEVICE=$(echo $IPAD_MODEL | tr -d "'")
100+
FASTLANE_OS_VERSION="$IOS_VERSION"
101+
;;
102+
"tv" )
103+
FASTLANE_DEVICE=$(echo $TV_MODEL | tr -d "'")
104+
FASTLANE_OS_VERSION="$TV_VERSION"
105+
;;
106+
* )
107+
echo "Error: Unknown DEST value '${DEST:-}'. DEST must be one of: iphone, ipad, tv"
108+
exit 1
109+
;;
110+
esac
111+
112+
SDK="$XC_SDK" DEVICE="$FASTLANE_DEVICE" OS_VERSION="$FASTLANE_OS_VERSION" SCHEME="$1" bundle exec fastlane test
95113
}
96114

97115
define_xc_macros

0 commit comments

Comments
 (0)