diff --git a/.github/workflows/wda-package.yml b/.github/workflows/wda-package.yml index 93ad63f91..37794e763 100644 --- a/.github/workflows/wda-package.yml +++ b/.github/workflows/wda-package.yml @@ -76,9 +76,19 @@ jobs: strategy: matrix: - # '' is for iOS - target: ['', '_tvOS'] - arch: [x86_64, arm64] + include: + - target: '' + arch: x86_64 + simulator_name: Debug-iphonesimulator + - target: '' + arch: arm64 + simulator_name: Debug-iphonesimulator + - target: '_tvOS' + arch: x86_64 + simulator_name: Debug-appletvsimulator + - target: '_tvOS' + arch: arm64 + simulator_name: Debug-appletvsimulator steps: - name: Checkout uses: actions/checkout@v3 @@ -89,10 +99,11 @@ jobs: run: | DESTINATION=$DESTINATION_SIM${{ matrix.target }} sh $GITHUB_WORKSPACE/Scripts/ci/build-sim.sh env: - TARGET: ${{ matrix.target }} SCHEME: WebDriverAgentRunner${{ matrix.target }} ARCHS: ${{ matrix.arch }} ZIP_PKG_NAME: "WebDriverAgentRunner${{ matrix.target }}-Build-Sim-${{ matrix.arch }}.zip" + DERIVED_DATA_PATH: wda_build + WD: wda_build/Build/Products/${{ matrix.simulator_name }} - name: Upload the built generic app package for WebDriverAgentRunner${{ matrix.target }} with ${{ matrix.arch }} uses: actions/upload-artifact@master with: diff --git a/Scripts/ci/build-real.sh b/Scripts/ci/build-real.sh index 33de1cc53..bb41b0b6f 100755 --- a/Scripts/ci/build-real.sh +++ b/Scripts/ci/build-real.sh @@ -1,7 +1,5 @@ #!/bin/bash -# To run build script for CI - xcodebuild clean build-for-testing \ -project WebDriverAgent.xcodeproj \ -derivedDataPath $DERIVED_DATA_PATH \ @@ -9,24 +7,18 @@ xcodebuild clean build-for-testing \ -destination "$DESTINATION" \ CODE_SIGNING_ALLOWED=NO ARCHS=arm64 -# Only .app is needed. - pushd $WD -# to remove test packages to refer to the device local instead of embedded ones -# XCTAutomationSupport.framework, XCTest.framewor, XCTestCore.framework, -# XCUIAutomation.framework, XCUnit.framework -rm -rf $SCHEME-Runner.app/Frameworks/XC*.framework - -# Xcode 16 started generating 5.9MB of 'Testing.framework', but it might not be necessary for WDA -rm -rf $SCHEME-Runner.app/Frameworks/Testing.framework - -# This library is used for Swift testing. WDA doesn't include Swift stuff, thus this is not needed. -# Xcode 16 generates a 2.6 MB file size. Xcode 15 was a 1 MB file size. -rm -rf $SCHEME-Runner.app/Frameworks/libXCTestSwiftSupport.dylib - - - -zip -r $ZIP_PKG_NAME $SCHEME-Runner.app +# The reason why here excludes several frameworks are: +# - to remove test packages to refer to the device local instead of embedded ones +# XCTAutomationSupport.framework, XCTest.framewor, XCTestCore.framework, +# XCUIAutomation.framework, XCUnit.framework. +# This can be excluded only for real devices. +# - Xcode 16 started generating 5.9MB of 'Testing.framework', but it might not be necessary for WDA. +# - libXCTestSwiftSupport is used for Swift testing. WDA doesn't include Swift stuff, thus this is not needed. +zip -r $ZIP_PKG_NAME $SCHEME-Runner.app \ + -x "$SCHEME-Runner.app/Frameworks/XC*.framework*" \ + "$SCHEME-Runner.app/Frameworks/Testing.framework*" \ + "$SCHEME-Runner.app/Frameworks/libXCTestSwiftSupport.dylib" popd mv $WD/$ZIP_PKG_NAME ./ diff --git a/Scripts/ci/build-sim.sh b/Scripts/ci/build-sim.sh index de52abccf..c8917d277 100755 --- a/Scripts/ci/build-sim.sh +++ b/Scripts/ci/build-sim.sh @@ -1,19 +1,19 @@ #!/bin/bash -# To run build script for CI - xcodebuild clean build-for-testing \ -project WebDriverAgent.xcodeproj \ - -derivedDataPath wda_build \ + -derivedDataPath $DERIVED_DATA_PATH \ -scheme $SCHEME \ -destination "$DESTINATION" \ CODE_SIGNING_ALLOWED=NO ARCHS=$ARCHS -# simulator needs to build entire build files +pushd $WD -pushd wda_build -# to remove unnecessary space consuming files -rm -rf Build/Intermediates.noindex -zip -r $ZIP_PKG_NAME Build +# The reason why here excludes several frameworks are: +# - Xcode 16 started generating 5.9MB of 'Testing.framework', but it might not be necessary for WDA. +# - libXCTestSwiftSupport is used for Swift testing. WDA doesn't include Swift stuff, thus this is not needed. +zip -r $ZIP_PKG_NAME $SCHEME-Runner.app \ + -x "$SCHEME-Runner.app/Frameworks/Testing.framework*" \ + "$SCHEME-Runner.app/Frameworks/libXCTestSwiftSupport.dylib" popd -mv wda_build/$ZIP_PKG_NAME ./ +mv $WD/$ZIP_PKG_NAME ./