diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1cc2e34..142befa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,33 +29,35 @@ jobs: runs-on: macOS-latest strategy: fail-fast: false - matrix: + matrix: destination: - 'platform=macOS' - 'platform=macOS,variant=Mac Catalyst' - 'platform=iOS Simulator,name=iPhone 11 Pro' - 'platform=tvOS Simulator,name=Apple TV' - 'platform=watchOS Simulator,name=Apple Watch Series 5 (40mm)' + xcode_version: ${{ fromJson(needs.generate-matrix.outputs.matrix).xcode_version }} env: - DEVELOPER_DIR: /Applications/Xcode_${{ needs.generate-matrix.outputs.latest-xcode-version }}.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer steps: - uses: actions/checkout@v4 - name: Run Test id: test run: | - platform=$(echo '${{ matrix.destination }}' | sed -E 's/platform=(.*)(,name=.*)/\1/g' | tr ' ' '_') + platform=$(echo '${{ matrix.destination }}' | sed -E 's/platform=([^,]*)(,name=.*)?/\1/g' | tr ' ' '_') echo "platform=$platform" >> $GITHUB_OUTPUT defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 xcrun xcodebuild \ -enableCodeCoverage=YES \ -scheme MockUserDefaults \ -destination '${{ matrix.destination }}' \ - -resultBundlePath "test_output/${{ matrix.xcode_version }}/$platform.xcresult" \ + -resultBundlePath "test_output/test_result.xcresult" \ test | xcpretty - name: Upload test result + if: ${{ matrix.xcode_version == needs.generate-matrix.outputs.latest-xcode-version }} uses: actions/upload-artifact@v3 with: - name: ${{ steps.test.outputs.platform }} + name: ${{ matrix.xcode_version }}-${{ steps.test.outputs.platform }} path: test_output if-no-files-found: error retention-days: 1 @@ -68,8 +70,7 @@ jobs: with: path: test_output - name: Merge xcresult files - run: - xcrun xcresulttool merge test_output/**/*.xcresult --output-path test_output/TestResults.xcresult + run: xcrun xcresulttool merge test_output/**/*.xcresult --output-path test_output/TestResults.xcresult - uses: kishikawakatsumi/xcresulttool@v1 if: success() || failure() with: