Skip to content

Commit

Permalink
Add test artifact upload for Android (#4508)
Browse files Browse the repository at this point in the history
b/379897683
  • Loading branch information
isarkis authored Dec 6, 2024
1 parent 399c7ca commit 32eb859
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ runs:
run: sccache -s
shell: bash
- name: Archive Android APKs
if: startsWith(${{matrix.platform}}, 'android')
if: startsWith(matrix.platform, 'android') && matrix.config == 'qa'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }} APKs
Expand Down
16 changes: 16 additions & 0 deletions .github/actions/upload_test_artifacts/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Test Artifact Upload
description: Uploads test archives to GCS for on-device tests.
runs:
using: "composite"
steps:
- name: Set up Cloud SDK
uses: isarkis/setup-gcloud@40dce7857b354839efac498d3632050f568090b6 # v1.1.1
- name: Upload Artifacts to GCS
env:
WORKFLOW: ${{ github.workflow }}
run: |
set -eux
project_name=$(gcloud config get-value project)
gsutil cp "${GITHUB_WORKSPACE}"/src/out/${{ matrix.platform }}_${{ matrix.config }}/**/*.apk \
gs://"${project_name}"-test-artifacts/"${WORKFLOW}"/"${GITHUB_RUN_NUMBER}"/${{matrix.platform}}/
shell: bash
1 change: 1 addition & 0 deletions .github/config/android-arm.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"system_webview_shell_apk",
"cobalt:gn_all"
],
"test_on_device": true,
"includes": [
{
"name":"arm",
Expand Down
1 change: 1 addition & 0 deletions .github/config/android-arm64.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"system_webview_shell_apk",
"cobalt:gn_all"
],
"test_on_device": true,
"includes": [
{
"name":"arm64",
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ jobs:
with:
targets: ${{ needs.initialize.outputs.targets }}
test_artifacts_key: ${{ env.TEST_ARTIFACTS_KEY }}
- name: Upload On Device Test Artifacts
if: matrix.config == 'devel' && needs.initialize.outputs.test_on_device == 'true'
uses: ./src/.github/actions/upload_test_artifacts

test:
needs: [initialize, docker-build-image, build]
Expand Down Expand Up @@ -193,13 +196,6 @@ jobs:
test_artifacts_key: ${{ env.TEST_ARTIFACTS_KEY }}
results_dir: ${{ env.TEST_RESULTS_DIR }}
platform: ${{ inputs.platform }}
- name: Run On-Device Tests
id: on-device-tests
if: always() && needs.initialize.outputs.test_on_device == 'true'
uses: ./src/.github/actions/on_device_tests
with:
test_artifacts_key: ${{ env.TEST_ARTIFACTS_KEY }}
results_dir: ${{ env.TEST_RESULTS_DIR }}
- name: Process Test Results
if: |
always() &&
Expand Down

0 comments on commit 32eb859

Please sign in to comment.