|
33 | 33 | submodules: 'true'
|
34 | 34 | ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
35 | 35 | timeout: 90
|
| 36 | + upload-artifact: android-apps |
36 | 37 | script: |
|
37 | 38 | set -eux
|
38 | 39 |
|
|
45 | 46 | PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh "${BUILD_TOOL}"
|
46 | 47 | # Build Android demo app
|
47 | 48 | bash build/test_android_ci.sh
|
| 49 | +
|
| 50 | + mkdir -p artifacts-to-be-uploaded |
| 51 | + # Copy the app and its test suite to S3 |
| 52 | + cp examples/demo-apps/android/LlamaDemo/app/build/outputs/apk/debug/*.apk artifacts-to-be-uploaded/ |
| 53 | + cp examples/demo-apps/android/LlamaDemo/app/build/outputs/apk/androidTest/debug/*.apk artifacts-to-be-uploaded/ |
| 54 | + # Also copy the share libraries |
| 55 | + cp cmake-out-android/lib/*.a artifacts-to-be-uploaded/ |
| 56 | +
|
| 57 | + # Upload the app and its test suite to S3 so that they can be downloaded by the test job |
| 58 | + upload-artifacts: |
| 59 | + needs: test-demo-android |
| 60 | + runs-on: linux.2xlarge |
| 61 | + steps: |
| 62 | + - name: Download the artifacts |
| 63 | + uses: actions/download-artifact@v3 |
| 64 | + with: |
| 65 | + # The name here needs to match the name of the upload-artifact parameter |
| 66 | + name: android-apps |
| 67 | + path: ${{ runner.temp }}/artifacts/ |
| 68 | + |
| 69 | + - name: Verify the artifacts |
| 70 | + shell: bash |
| 71 | + working-directory: ${{ runner.temp }}/artifacts/ |
| 72 | + run: | |
| 73 | + ls -lah ./ |
| 74 | +
|
| 75 | + - name: Upload the artifacts to S3 |
| 76 | + uses: seemethere/upload-artifact-s3@v5 |
| 77 | + with: |
| 78 | + s3-bucket: gha-artifacts |
| 79 | + s3-prefix: | |
| 80 | + ${{ github.repository }}/${{ github.run_id }}/artifact |
| 81 | + retention-days: 14 |
| 82 | + if-no-files-found: ignore |
| 83 | + path: ${{ runner.temp }}/artifacts/ |
| 84 | + |
| 85 | + # Let's see how expensive this job is, we might want to tone it down by running it periodically |
| 86 | + test-llama-app: |
| 87 | + needs: upload-artifacts |
| 88 | + permissions: |
| 89 | + id-token: write |
| 90 | + contents: read |
| 91 | + uses: pytorch/test-infra/.github/workflows/mobile_job.yml@main |
| 92 | + with: |
| 93 | + device-type: android |
| 94 | + runner: ubuntu-latest |
| 95 | + test-infra-ref: '' |
| 96 | + # This is the ARN of ExecuTorch project on AWS |
| 97 | + project-arn: arn:aws:devicefarm:us-west-2:308535385114:project:02a2cf0f-6d9b-45ee-ba1a-a086587469e6 |
| 98 | + # This is the custom Android device pool that only includes Samsung Galaxy S2x |
| 99 | + device-pool-arn: arn:aws:devicefarm:us-west-2:308535385114:devicepool:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/e59f866a-30aa-4aa1-87b7-4510e5820dfa |
| 100 | + # Uploaded to S3 from the previous job, the name of the app comes from the project itself |
| 101 | + android-app-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/app-debug.apk |
| 102 | + android-test-archive: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifact/app-debug-androidTest.apk |
| 103 | + # The test spec can be downloaded from https://ossci-assets.s3.amazonaws.com/android-llama2-device-farm-test-spec.yml |
| 104 | + test-spec: arn:aws:devicefarm:us-west-2:308535385114:upload:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/414cb54d-4d83-4576-8317-93244e4dc50e |
| 105 | + # The exported llama2 model and its tokenizer, can be downloaded from https://ossci-assets.s3.amazonaws.com/executorch-android-llama2-7b.zip. |
| 106 | + # Among the input, this is the biggest file and uploading it to AWS beforehand makes the test run much faster |
| 107 | + extra-data: arn:aws:devicefarm:us-west-2:308535385114:upload:02a2cf0f-6d9b-45ee-ba1a-a086587469e6/bd15825b-ddab-4e47-9fef-a9c8935778dd |
0 commit comments