Skip to content

Commit

Permalink
Cached UI Testing (#35)
Browse files Browse the repository at this point in the history
* Update ui-test.yml

* Update ui-test.yml

* Update ui-test.yml

* Update ui-test.yml

* Update ui-test.yml
  • Loading branch information
WindowsMEMZ authored Dec 16, 2023
1 parent ee31f05 commit 28f4dba
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,42 @@ jobs:
run: |
brew install chargepoint/xcparse/xcparse
mkdir Caches
- name: Restore Caches
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-ui-test-cache-
path: ~/Library/Developer/Xcode/DerivedData

- name: Update Status Env
run: echo "FIN_STATUS=failure" >> $GITHUB_ENV

- name: Resolve Package Dependencies
run: xcodebuild -resolvePackageDependencies -project ./DarockBili.xcodeproj -scheme 'DarockBili Watch App'

- name: Build for Testing
run: xcodebuild build-for-testing -scheme 'DarockBili Watch App' -project ./DarockBili.xcodeproj -destination 'platform=watchOS Simulator,name=Apple Watch Series 7 (41mm),OS=10.0' -testProductsPath ./Caches/TestProducts.xctestproducts -testPlan WatchAppUITestPlan -IDEPostProgressNotifications=YES COMPILER_INDEX_STORE_ENABLE=NO -quiet

- name: Get Current Time
id: current-time
run: echo "time=$(date +"%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT

- name: Save Caches
uses: actions/cache/save@v3
with:
key: ${{ runner.os }}-ui-test-cache-${{ steps.current-time.outputs.time }}
path: ~/Library/Developer/Xcode/DerivedData

- name: Run DarockBili Watch App UI Test
run: |
xcodebuild test -scheme 'DarockBili Watch App' -configuration Release -destination 'platform=watchOS Simulator,name=Apple Watch Series 7 (41mm),OS=10.0' -testPlan WatchAppUITestPlan -testProductsPath ./Caches/TestProducts.xctestproducts -derivedDataPath ./Caches/DerivedData
xcodebuild test-without-building -destination 'platform=watchOS Simulator,name=Apple Watch Series 7 (41mm),OS=10.0' -testPlan WatchAppUITestPlan -testProductsPath ./Caches/TestProducts.xctestproducts IDEPostProgressNotifications=YES -DTDKDisableSymbolCopying=YES
echo "FIN_STATUS=success" >> $GITHUB_ENV
- name: Process Test Result
run: |
mv ./Caches/DerivedData/Logs/Test/Test-*.xcresult ./Caches/DerivedData/Logs/Test/Test-1.xcresult
mv ~/Library/Developer/Xcode/DerivedData/DarockBili-*/Logs/Test/Test-*.xcresult ./Caches/Test-1.xcresult
mkdir Caches/ExportFiles
xcparse -s ./Caches/DerivedData/Logs/Test/Test-1.xcresult ./Caches/ExportFiles
xcparse -s ./Caches/Test-1.xcresult ./Caches/ExportFiles
- name: Upload Test Attachments
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 28f4dba

Please sign in to comment.