Skip to content

Commit

Permalink
Split testing up into build and run steps
Browse files Browse the repository at this point in the history
  • Loading branch information
mbernson committed May 13, 2024
1 parent a820dde commit 5fac7ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,31 @@ jobs:
-resolvePackageDependencies \
-clonedSourcePackagesDirPath "${{ runner.temp }}/SourcePackages"
- name: Determine test device
run: |
echo "PLATFORM=iOS Simulator" >> "$GITHUB_ENV"
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
echo "DEVICE=$(xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//")" >> "$GITHUB_ENV"
- name: Build for testing
env:
PLATFORM: ${{ 'iOS Simulator' }}
run: |
xcodebuild build-for-testing -project "${{ env.XCODE_PROJECT }}" \
-scheme "${{ env.SCHEME }}" \
-destination "platform=$PLATFORM,name=$DEVICE" \
-clonedSourcePackagesDirPath "${{ runner.temp }}/SourcePackages" \
-disableAutomaticPackageResolution
- name: Run tests
env:
PLATFORM: ${{ 'iOS Simulator' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
DEVICE=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
xcodebuild test -project "${{ env.XCODE_PROJECT }}" \
xcodebuild test-without-building -project "${{ env.XCODE_PROJECT }}" \
-scheme "${{ env.SCHEME }}" \
-testPlan "${{ env.TEST_PLAN }}" \
-destination "platform=$PLATFORM,name=$DEVICE" \
-resultBundlePath "${{ env.TEST_RESULT_BUNDLE }}" \
-clonedSourcePackagesDirPath "${{ runner.temp }}/SourcePackages" \
-disableAutomaticPackageResolution
- name: Upload test result bundle
uses: actions/upload-artifact@v4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "df61673358a3dd22a0a9edeab8644d322d2a83e7c60f21b1fb5968be13760d2c",
"originHash" : "7f5d67830751eed43216e3b2c4a63415b54e9f0b67f3d3f4d7fb12143114915a",
"pins" : [
{
"identity" : "factory",
Expand Down

0 comments on commit 5fac7ab

Please sign in to comment.