Skip to content

Commit 72c88fe

Browse files
committed
ci: use specific test folder
1 parent ea90313 commit 72c88fe

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

.github/workflows/npm_release.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,31 @@ jobs:
9494
npm install -g @edusperoni/junit-cli-report-viewer verify-junit-xml
9595
- name: Prepare
9696
run: npm run setup-ci
97+
- name: Prepare test folder
98+
run: |
99+
mkdir -p dist-test
100+
echo TEST_FOLDER=$(pwd)/dist-test >> $GITHUB_ENV
97101
- name: Xcode Tests
98102
uses: nick-fields/retry@v2
99103
# try to run the tests with xcpretty. If it fails then try again without xcpretty twice for better log output
100104
# the xcode tests are a bit flaky and they should never fail on this step, as this step only collects the JS test results as junit xml
101105
with:
102106
timeout_minutes: 20
103107
max_attempts: 3
104-
command: set -o pipefail && xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $HOME/test_results -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPhone\ 14\ Pro\ Max build test | xcpretty
105-
on_retry_command: rm -rf $HOME/test_results*
106-
new_command_on_retry: xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $HOME/test_results -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPhone\ 14\ Pro\ Max build test
108+
command: set -o pipefail && xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $TEST_FOLDER/test_results -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPhone\ 14\ Pro\ Max build test | xcpretty
109+
on_retry_command: rm -rf $TEST_FOLDER/test_results*
110+
new_command_on_retry: xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $TEST_FOLDER/test_results -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPhone\ 14\ Pro\ Max build test
107111
- name: Validate Test Results
108112
run: |
109-
xcparse attachments $HOME/test_results.xcresult $HOME/test-out
110-
find $HOME/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx junit-cli-report-viewer
111-
find $HOME/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx verify-junit-xml
113+
xcparse attachments $TEST_FOLDER/test_results.xcresult $TEST_FOLDER/test-out
114+
find $TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx junit-cli-report-viewer
115+
find $TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx verify-junit-xml
112116
- name: Archive Test Result Data
113117
if: always()
114118
uses: actions/upload-artifact@v3
115119
with:
116120
name: test-results
117-
path: ${{env.HOME}}/test_results.xcresult
121+
path: ${{env.TEST_FOLDER}}/test_results.xcresult
118122
publish:
119123
runs-on: ubuntu-latest
120124
needs:

.github/workflows/pull_request.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,29 @@ jobs:
7676
[ ! -f /usr/local/bin/cmake ] && ln -s /usr/local/bin/cmake $(which cmake) || true
7777
brew install chargepoint/xcparse/xcparse
7878
npm install -g @edusperoni/junit-cli-report-viewer verify-junit-xml
79+
- name: Prepare test folder
80+
id: prepare-test-folder
81+
run: |
82+
mkdir -p dist-test
83+
echo TEST_FOLDER=$(pwd)/dist-test >> $GITHUB_ENV
7984
- name: Xcode Tests
8085
uses: nick-fields/retry@v2
8186
# try to run the tests with xcpretty. If it fails then try again without xcpretty twice for better log output
8287
# the xcode tests are a bit flaky and they should never fail on this step, as this step only collects the JS test results as junit xml
8388
with:
8489
timeout_minutes: 20
8590
max_attempts: 3
86-
command: set -o pipefail && xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $HOME/test_results -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPhone\ 14\ Pro\ Max build test | xcpretty
87-
on_retry_command: rm -rf $HOME/test_results*
88-
new_command_on_retry: xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $HOME/test_results -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPhone\ 14\ Pro\ Max build test
91+
command: set -o pipefail && xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $TEST_FOLDER/test_results -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPhone\ 14\ Pro\ Max build test | xcpretty
92+
on_retry_command: rm -rf $TEST_FOLDER/test_results*
93+
new_command_on_retry: xcodebuild -project v8ios.xcodeproj -scheme TestRunner -resultBundlePath $TEST_FOLDER/test_results -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPhone\ 14\ Pro\ Max build test
8994
- name: Validate Test Results
9095
run: |
91-
xcparse attachments $HOME/test_results.xcresult $HOME/test-out
92-
find $HOME/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx junit-cli-report-viewer
93-
find $HOME/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx verify-junit-xml
96+
xcparse attachments $TEST_FOLDER/test_results.xcresult $TEST_FOLDER/test-out
97+
find $TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx junit-cli-report-viewer
98+
find $TEST_FOLDER/test-out -name "*junit*.xml" -maxdepth 1 -print0 | xargs -n 1 -0 npx verify-junit-xml
9499
- name: Archive Test Result Data
95100
if: always()
96101
uses: actions/upload-artifact@v3
97102
with:
98103
name: test-results
99-
path: ${{env.HOME}}/test_results.xcresult
104+
path: ${{env.TEST_FOLDER}}/test_results.xcresult

0 commit comments

Comments
 (0)