Skip to content

Commit 95c8118

Browse files
authored
ci: sim remove unnecessary files (#1037)
* ci: remove unnecessary files from the prebuilt package * adjust the path * debug * debug * use cd instead * modify * fix $WD * use exclude instead * tweakd * modify * modify more * modify more
1 parent e4cae74 commit 95c8118

3 files changed

Lines changed: 35 additions & 32 deletions

File tree

.github/workflows/wda-package.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,19 @@ jobs:
7676

7777
strategy:
7878
matrix:
79-
# '' is for iOS
80-
target: ['', '_tvOS']
81-
arch: [x86_64, arm64]
79+
include:
80+
- target: ''
81+
arch: x86_64
82+
simulator_name: Debug-iphonesimulator
83+
- target: ''
84+
arch: arm64
85+
simulator_name: Debug-iphonesimulator
86+
- target: '_tvOS'
87+
arch: x86_64
88+
simulator_name: Debug-appletvsimulator
89+
- target: '_tvOS'
90+
arch: arm64
91+
simulator_name: Debug-appletvsimulator
8292
steps:
8393
- name: Checkout
8494
uses: actions/checkout@v3
@@ -89,10 +99,11 @@ jobs:
8999
run: |
90100
DESTINATION=$DESTINATION_SIM${{ matrix.target }} sh $GITHUB_WORKSPACE/Scripts/ci/build-sim.sh
91101
env:
92-
TARGET: ${{ matrix.target }}
93102
SCHEME: WebDriverAgentRunner${{ matrix.target }}
94103
ARCHS: ${{ matrix.arch }}
95104
ZIP_PKG_NAME: "WebDriverAgentRunner${{ matrix.target }}-Build-Sim-${{ matrix.arch }}.zip"
105+
DERIVED_DATA_PATH: wda_build
106+
WD: wda_build/Build/Products/${{ matrix.simulator_name }}
96107
- name: Upload the built generic app package for WebDriverAgentRunner${{ matrix.target }} with ${{ matrix.arch }}
97108
uses: actions/upload-artifact@master
98109
with:

Scripts/ci/build-real.sh

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
#!/bin/bash
22

3-
# To run build script for CI
4-
53
xcodebuild clean build-for-testing \
64
-project WebDriverAgent.xcodeproj \
75
-derivedDataPath $DERIVED_DATA_PATH \
86
-scheme $SCHEME \
97
-destination "$DESTINATION" \
108
CODE_SIGNING_ALLOWED=NO ARCHS=arm64
119

12-
# Only .app is needed.
13-
1410
pushd $WD
1511

16-
# to remove test packages to refer to the device local instead of embedded ones
17-
# XCTAutomationSupport.framework, XCTest.framewor, XCTestCore.framework,
18-
# XCUIAutomation.framework, XCUnit.framework
19-
rm -rf $SCHEME-Runner.app/Frameworks/XC*.framework
20-
21-
# Xcode 16 started generating 5.9MB of 'Testing.framework', but it might not be necessary for WDA
22-
rm -rf $SCHEME-Runner.app/Frameworks/Testing.framework
23-
24-
# This library is used for Swift testing. WDA doesn't include Swift stuff, thus this is not needed.
25-
# Xcode 16 generates a 2.6 MB file size. Xcode 15 was a 1 MB file size.
26-
rm -rf $SCHEME-Runner.app/Frameworks/libXCTestSwiftSupport.dylib
27-
28-
29-
30-
zip -r $ZIP_PKG_NAME $SCHEME-Runner.app
12+
# The reason why here excludes several frameworks are:
13+
# - to remove test packages to refer to the device local instead of embedded ones
14+
# XCTAutomationSupport.framework, XCTest.framewor, XCTestCore.framework,
15+
# XCUIAutomation.framework, XCUnit.framework.
16+
# This can be excluded only for real devices.
17+
# - Xcode 16 started generating 5.9MB of 'Testing.framework', but it might not be necessary for WDA.
18+
# - libXCTestSwiftSupport is used for Swift testing. WDA doesn't include Swift stuff, thus this is not needed.
19+
zip -r $ZIP_PKG_NAME $SCHEME-Runner.app \
20+
-x "$SCHEME-Runner.app/Frameworks/XC*.framework*" \
21+
"$SCHEME-Runner.app/Frameworks/Testing.framework*" \
22+
"$SCHEME-Runner.app/Frameworks/libXCTestSwiftSupport.dylib"
3123
popd
3224
mv $WD/$ZIP_PKG_NAME ./

Scripts/ci/build-sim.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
#!/bin/bash
22

3-
# To run build script for CI
4-
53
xcodebuild clean build-for-testing \
64
-project WebDriverAgent.xcodeproj \
7-
-derivedDataPath wda_build \
5+
-derivedDataPath $DERIVED_DATA_PATH \
86
-scheme $SCHEME \
97
-destination "$DESTINATION" \
108
CODE_SIGNING_ALLOWED=NO ARCHS=$ARCHS
119

12-
# simulator needs to build entire build files
10+
pushd $WD
1311

14-
pushd wda_build
15-
# to remove unnecessary space consuming files
16-
rm -rf Build/Intermediates.noindex
17-
zip -r $ZIP_PKG_NAME Build
12+
# The reason why here excludes several frameworks are:
13+
# - Xcode 16 started generating 5.9MB of 'Testing.framework', but it might not be necessary for WDA.
14+
# - libXCTestSwiftSupport is used for Swift testing. WDA doesn't include Swift stuff, thus this is not needed.
15+
zip -r $ZIP_PKG_NAME $SCHEME-Runner.app \
16+
-x "$SCHEME-Runner.app/Frameworks/Testing.framework*" \
17+
"$SCHEME-Runner.app/Frameworks/libXCTestSwiftSupport.dylib"
1818
popd
19-
mv wda_build/$ZIP_PKG_NAME ./
19+
mv $WD/$ZIP_PKG_NAME ./

0 commit comments

Comments
 (0)