Skip to content

Commit 9268f8f

Browse files
committed
ci: move test report to its own workflow for better security
1 parent 56ee239 commit 9268f8f

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

.github/workflows/npm_release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: NPM Release
12
on:
23
push:
34
branches:
@@ -90,7 +91,7 @@ jobs:
9091
with:
9192
name: debug-symbols
9293
path: test-app/runtime/build/intermediates/merged_native_libs/release/mergeReleaseNativeLibs/out/lib/*
93-
94+
9495
test:
9596
name: Test
9697
runs-on: macos-15-intel
@@ -143,6 +144,12 @@ jobs:
143144
#target: google_apis
144145
arch: ${{env.ANDROID_ABI}}
145146
script: ./gradlew runtestsAndVerifyResults --stacktrace
147+
- name: Upload Test Results
148+
if: ${{ !cancelled() }} # run this step even if previous step failed
149+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
150+
with:
151+
name: android-unit-test-results
152+
path: test-app/dist/android_unit_test_results.xml
146153
publish:
147154
runs-on: ubuntu-latest
148155
environment: npm-publish

.github/workflows/pull_request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: Pull Request
12
on:
23
pull_request:
34

@@ -128,10 +129,9 @@ jobs:
128129
#target: google_apis
129130
arch: ${{env.ANDROID_ABI}}
130131
script: ./gradlew runtestsAndVerifyResults --stacktrace
131-
- name: Test Report
132-
uses: dorny/test-reporter@b082adf0eced0765477756c2a610396589b8c637 # v2.5.0
132+
- name: Upload Test Results
133133
if: ${{ !cancelled() }} # run this step even if previous step failed
134+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
134135
with:
135-
name: Android Runtime Tests
136+
name: android-unit-test-results
136137
path: test-app/dist/android_unit_test_results.xml
137-
reporter: jest-junit # Format of test results

.github/workflows/test_report.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Test Report"
2+
on:
3+
workflow_run:
4+
workflows: ["Pull Request", "NPM Release"] # runs after Pull Request workflow
5+
types:
6+
- completed
7+
permissions:
8+
contents: read
9+
actions: read
10+
checks: write
11+
jobs:
12+
report:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: dorny/test-reporter@b082adf0eced0765477756c2a610396589b8c637 # v2.5.0
16+
with:
17+
name: Android Runtime Tests
18+
artifact: android-unit-test-results # artifact name
19+
path: test-app/dist/android_unit_test_results.xml
20+
reporter: jest-junit # Format of test results

0 commit comments

Comments
 (0)