Run benchmark on request (#1932)

This commit is contained in:
Bart Louwers
2023-12-08 16:28:50 +01:00
committed by GitHub
parent efa70a41ee
commit 23c046bf98
3 changed files with 30 additions and 19 deletions

View File

@@ -125,7 +125,6 @@ jobs:
cp MapboxGLAndroidSDKTestApp/build/outputs/apk/drawable/release/MapboxGLAndroidSDKTestApp-drawable-release.apk .
cp MapboxGLAndroidSDKTestApp/build/outputs/apk/androidTest/drawable/release/MapboxGLAndroidSDKTestApp-drawable-release-androidTest.apk .
- name: Create artifact for benchmark APKs
uses: actions/upload-artifact@v3
if: github.ref != 'refs/heads/main'
@@ -136,6 +135,9 @@ jobs:
platform/android/MapboxGLAndroidSDKTestApp-drawable-release.apk
platform/android/MapboxGLAndroidSDKTestApp-drawable-release-androidTest.apk
- if: github.event_name == 'pull_request'
uses: ./.github/actions/save-pr-number
- name: Build UI tests
if: github.ref == 'refs/heads/main'
run: make android-ui-test-arm-v8

View File

@@ -47,7 +47,20 @@ jobs:
app_id: ${{ secrets.MAPLIBRE_NATIVE_BOT_APP_ID }}
private_key: ${{ secrets.MAPLIBRE_NATIVE_BOT_PRIVATE_KEY }}
- run: echo ${{ toJSON(github.event.workflow_run) }}
- uses: ./.github/actions/get-pr-number
id: get-pr-number
- name: Check if comment on PR contains '!benchmark android'
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ steps.get-pr-number.outputs.pr-number }}
body-regex: '^!benchmark.*android.*$'
- uses: LouisBrunner/checks-action@v1.6.2
if: matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id
id: create_check
with:
token: ${{ steps.generate_token.outputs.token }}
@@ -57,17 +70,19 @@ jobs:
sha: ${{ github.event.workflow_run.head_sha }}
- uses: ./.github/actions/download-workflow-run-artifact
if: matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id
with:
artifact-name: ${{ matrix.test.artifactName }}
- name: Check if test files exist (otherwise the parent workflow was skipped)
if: matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id
id: check_files
uses: andstor/file-existence-action@v2.0.0
with:
files: "${{ matrix.test.testFile }}, ${{ matrix.test.appFile }}"
- uses: ./.github/actions/aws-device-farm-run
if: steps.check_files.outputs.files_exists == 'true'
if: steps.check_files.outputs.files_exists == 'true' && (matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id)
with:
name: ${{ matrix.test.name }}
appType: ANDROID_APP
@@ -75,6 +90,7 @@ jobs:
testFile: ${{ matrix.test.testFile }}
testPackageType: INSTRUMENTATION_TEST_PACKAGE
testType: INSTRUMENTATION
testFilter: ${{ matrix.test.testFilter }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ROLE_TO_ASSUME: ${{ vars.AWS_ROLE_TO_ASSUME }}
@@ -83,7 +99,7 @@ jobs:
externalData: ${{ matrix.test.externalData }}
- uses: LouisBrunner/checks-action@v1.6.2
if: always()
if: always() && (matrix.test.name != 'Android Benchmark' || steps.fc.outputs.comment-id)
with:
token: ${{ steps.generate_token.outputs.token }}
check_id: ${{ steps.create_check.outputs.check_id }}