Skip to content

test

test #912

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"
build:
# The type of runner that the job will run on
runs-on: macos-latest
# 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
# Setup gradle caching to reduce AVD start-up time
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-30
- 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: 30
# target: google_apis
# arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: echo "Generated AVD snapshot for caching."
# Execute unit tests
- name: Unit Test with Android Emulator Runner
uses: reactivecircus/android-emulator-runner@v2
with:
# target: google_apis
# arch: x86_64
api-level: 30
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