-
Notifications
You must be signed in to change notification settings - Fork 48
102 lines (90 loc) · 4 KB
/
codecov.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
95
96
97
98
99
100
101
102
name: Code Coverage Check
on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
codeCoverage:
# https://github.com/ReactiveCircus/android-emulator-runner/issues/386
runs-on: macos-13
strategy:
matrix:
api-level: [30]
# API 30+ emulators only have x86_64 system images.
arch: ["x86_64"]
target: [default] # Other option: google_apis
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Download amazon-chime-sdk-media binary from AWS S3
- name: Get Media binary from AWS S3
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} --profile jenkins-automated-test
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} --profile jenkins-automated-test
aws \
--profile jenkins-automated-test \
s3api get-object \
--bucket amazon-chime-sdk-android-internal \
--key master/media/latest/amazon-chime-sdk-media.tar.gz \
amazon-chime-sdk-media.tar.gz
tar -xzf amazon-chime-sdk-media.tar.gz
mkdir -p ./amazon-chime-sdk/libs
mv amazon-chime-sdk-media.aar ./amazon-chime-sdk/libs
# Download amazon-chime-sdk-machine-learning binary from AWS S3
- name: Get Machine Learning binary from AWS S3
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} --profile jenkins-automated-test
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} --profile jenkins-automated-test
aws \
--profile jenkins-automated-test \
s3api get-object \
--bucket amazon-chime-sdk-android-internal \
--key master/machine-learning/latest/amazon-chime-sdk-machine-learning.tar.gz \
amazon-chime-sdk-machine-learning.tar.gz
tar -xzf amazon-chime-sdk-machine-learning.tar.gz
mkdir -p ./amazon-chime-sdk/libs
mv amazon-chime-sdk-machine-learning.aar ./amazon-chime-sdk/libs
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.target }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: ${{ matrix.target }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
# Execute unit tests
- name: Unit Test with Android Emulator Runner
uses: reactiveCircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: ${{ matrix.target }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew jacocoTestReport --stacktrace
# Upload code coverage report to codecov to process data
- name: Upload coverage to Codecov
uses: codecov/[email protected]