Skip to content

Commit

Permalink
fix matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
417-72KI committed Sep 16, 2023
1 parent 0e0a6c8 commit b37479e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit b37479e

Please sign in to comment.