Skip to content

test

test #915

Workflow file for this run

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:
# The type of runner that the job will run on
runs-on: macos-latest
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."
# 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/codecov-action@v1.2.1