From a22e8416af9bfc2501689d71cbae3ce1ca286945 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Sat, 24 Feb 2024 14:47:17 +0800 Subject: [PATCH 1/3] [github-action] Try to workaround visionOS simulator bug in unit tests Seems need to boot the simulator firstly, other platforms does not has this issue --- .github/workflows/CI.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 93a864c1..05ed427f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -137,19 +137,22 @@ jobs: run: | rm -rf ~/Library/Developer/Xcode/DerivedData/ mkdir DerivedData + + - if: ${{ matrix.platform }} == 'visionOS' + run: xcrun simctl boot "Apple Vision Pro" - name: Run test run: | set -o pipefail xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests ${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO - mv ~/Library/Developer/Xcode/DerivedData/ "./DerivedData/{{ matrix.platform }}" + mv ~/Library/Developer/Xcode/DerivedData/ "./DerivedData/${{ matrix.platform }}" - name: Code Coverage run: | set -o pipefail export PATH="/usr/local/opt/curl/bin:$PATH" curl --version - bash <(curl -s https://codecov.io/bash) -v -D "./DerivedData/{{ matrix.platform }}" -J '^SDWebImage$' -c -X gcov -F "{{ matrix.platform }}" + bash <(curl -s https://codecov.io/bash) -v -D "./DerivedData/${{ matrix.platform }}" -J '^SDWebImage$' -c -X gcov -F "${{ matrix.platform }}" Build: name: Build Library From 684efe0ccd8767f704e032a5a4b0da572618a8c9 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Sat, 24 Feb 2024 15:15:03 +0800 Subject: [PATCH 2/3] [github-action] Change to build and test-without-building --- .github/workflows/CI.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 05ed427f..28074929 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -138,13 +138,14 @@ jobs: rm -rf ~/Library/Developer/Xcode/DerivedData/ mkdir DerivedData - - if: ${{ matrix.platform }} == 'visionOS' + - if: ${{ matrix.platform }} == visionOS run: xcrun simctl boot "Apple Vision Pro" - name: Run test run: | set -o pipefail - xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests ${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO + xcodebuild build-for-testing -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests ${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c + xcodebuild test-without-building -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests ${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO mv ~/Library/Developer/Xcode/DerivedData/ "./DerivedData/${{ matrix.platform }}" - name: Code Coverage From 4bb2a0e124cc0bd61959f4bd66288a4ecd837957 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Sat, 24 Feb 2024 15:29:12 +0800 Subject: [PATCH 3/3] Disable visionOS unit test until Apple or GitHub Action fix the issue :( --- .github/workflows/CI.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 28074929..06fc2714 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -103,7 +103,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [iOS, macOS, tvOS, visionOS] + platform: [iOS, macOS, tvOS] include: - platform: iOS destination: platform=iOS Simulator,name=iPhone 15 Pro @@ -114,12 +114,14 @@ jobs: - platform: tvOS destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation) scheme: TV - - platform: visionOS - destination: platform=visionOS Simulator,name=Apple Vision Pro - scheme: Vision + # - platform: visionOS + # destination: platform=visionOS Simulator,name=Apple Vision Pro + # scheme: Vision steps: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install Cocoapods run: gem install cocoapods --no-document --quiet @@ -137,9 +139,6 @@ jobs: run: | rm -rf ~/Library/Developer/Xcode/DerivedData/ mkdir DerivedData - - - if: ${{ matrix.platform }} == visionOS - run: xcrun simctl boot "Apple Vision Pro" - name: Run test run: |