-
Notifications
You must be signed in to change notification settings - Fork 354
94 lines (81 loc) · 3.12 KB
/
upload-android-test-specs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Upload AWS Device Farm Android test specs
on:
pull_request:
paths:
- .github/workflows/upload-android-test-specs.yml
- extension/android/benchmark/android-llm-device-farm-test-spec.yml
push:
branches:
- main
paths:
- .github/workflows/upload-android-test-specs.yml
- extension/android/benchmark/android-llm-device-farm-test-spec.yml
concurrency:
# NB: This concurency group needs to be different than the one used in android-perf, otherwise
# GH complains about concurrency deadlock
group: android-spec-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true
jobs:
upload-android-test-spec-for-validation:
runs-on: linux.2xlarge
steps:
- uses: actions/checkout@v3
- name: Upload the spec as a GitHub artifact for validation
uses: seemethere/upload-artifact-s3@v5
with:
s3-bucket: gha-artifacts
s3-prefix: |
${{ github.repository }}/${{ github.run_id }}/artifacts
retention-days: 1
if-no-files-found: error
path: extension/android/benchmark/android-llm-device-farm-test-spec.yml
validate-android-test-spec:
needs: upload-android-test-spec-for-validation
uses: ./.github/workflows/android-perf.yml
permissions:
id-token: write
contents: read
with:
# Just use a small model here with a minimal amount of configuration to test the spec
models: stories110M
devices: samsung_galaxy_s22
delegates: xnnpack
test_spec: https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/android-llm-device-farm-test-spec.yml
upload-android-test-spec:
needs: validate-android-test-spec
runs-on: ubuntu-22.04
timeout-minutes: 15
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: pip
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1.7.0
with:
role-to-assume: arn:aws:iam::308535385114:role/gha_executorch_upload-frameworks-android
aws-region: us-east-1
- name: Only push to S3 when running the workflow manually from main branch
if: ${{ github.ref == 'refs/heads/main' }}
shell: bash
run: |
set -eux
echo "UPLOAD_ON_MAIN=1" >> "${GITHUB_ENV}"
- name: Upload the spec to S3 ossci-android bucket
shell: bash
working-directory: extension/android/benchmark/
env:
SPEC_FILE: android-llm-device-farm-test-spec.yml
run: |
set -eux
pip install awscli==1.32.18
AWS_CMD="aws s3 cp --dryrun"
if [[ "${UPLOAD_ON_MAIN:-0}" == "1" ]]; then
AWS_CMD="aws s3 cp"
fi
shasum -a 256 "${SPEC_FILE}"
${AWS_CMD} "${SPEC_FILE}" s3://ossci-android/executorch/ --acl public-read