From c120cdc527119e99bae0919bc95e1ae376b299ba Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Fri, 10 Feb 2023 14:59:49 -0800 Subject: [PATCH] [ObjC] Move the Xcode CI off full_mac_build.sh Use the bash GHA to ensure WKTs are current, and then just directly invoke Xcode. This means the script full_mac_build.sh can go back to just being a simpler helper for folks doing local builds and we can remove all the extra support that was needed for CI. PiperOrigin-RevId: 508762464 --- .github/BUILD.bazel | 6 ++++- .github/workflows/test_objectivec.yml | 37 +++++++++++++++------------ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/BUILD.bazel b/.github/BUILD.bazel index 98a95d1bb8..12daec4a37 100644 --- a/.github/BUILD.bazel +++ b/.github/BUILD.bazel @@ -1,5 +1,9 @@ # This information is extracted from the MacOS runner specs located at: -# https://github.com/actions/runner-images/blob/win19/20230129.2/images/macos/macos-12-Readme.md +# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md +# +# When updating, also ensure the "xcode_destination" entries in +# `.github/workflows/test_objectivec.yml` are supported for the given versions +# of Xcode. xcode_version( name = "version14_2_14C18", version = "14.2.14C18", diff --git a/.github/workflows/test_objectivec.yml b/.github/workflows/test_objectivec.yml index f572d6d19d..465e022592 100644 --- a/.github/workflows/test_objectivec.yml +++ b/.github/workflows/test_objectivec.yml @@ -13,20 +13,19 @@ jobs: strategy: fail-fast: false # Don't cancel all jobs if one fails. matrix: + platform: ["macOS", "iOS"] + xc_config: ["Debug", "Release"] + # The "destination" entries need to match what is available for the selected Xcode. + # See `.github/BUILD.bazel` for the Xcode info. include: - - name: macOS - config: osx - flags: --skip-xcode-ios --skip-xcode-tvos --skip-objc-conformance - # The iOS simulator takes a while to start up, so Debug & Release are run in - # parallel to get the testing done faster. - - name: iOS Debug - config: ios_debug - flags: --skip-xcode-osx --skip-xcode-tvos --skip-objc-conformance --skip-xcode-release - - name: iOS Release - config: ios_release - flags: --skip-xcode-osx --skip-xcode-tvos --skip-objc-conformance --skip-xcode-debug + - platform: "macOS" + destination: "platform=macOS" + xc_project: "ProtocolBuffers_OSX.xcodeproj" + - platform: "iOS" + destination: "platform=iOS Simulator,name=iPhone 13,OS=latest" + xc_project: "ProtocolBuffers_iOS.xcodeproj" - name: Xcode ${{ matrix.name}} + name: Xcode ${{ matrix.platform}} ${{ matrix.xc_config }} runs-on: macos-12 env: DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer @@ -39,18 +38,24 @@ jobs: - name: Setup ccache uses: ./.github/actions/ccache with: - cache-prefix: objectivec_macos_${{ matrix.config }} + cache-prefix: objectivec_${{ matrix.platform }}_${{ matrix.xc_config }} support-modules: true - name: Run tests - uses: ./.github/actions/bazel + uses: ./.github/actions/bash env: CC: ${{ github.workspace }}/ci/clang_wrapper CXX: ${{ github.workspace }}/ci/clang_wrapper++ with: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} - bazel-cache: objectivec_macos/${{ matrix.config }} - bash: objectivec/DevTools/full_mac_build.sh ${{ matrix.flags }} + command: | + xcodebuild \ + -project "objectivec/${{ matrix.xc_project }}" \ + -scheme ProtocolBuffers \ + -configuration ${{ matrix.xc_config }} \ + -destination "${{ matrix.destination }}" \ + test \ + | xcpretty - name: Report ccache stats shell: bash