SystemTests #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SystemTests | |
on: | |
pull_request: | |
branches: | |
- main | |
schedule: | |
# Trigger on start of the day every working day (stolen from player nightly) | |
- cron: '0 0 * * MON-FRI' | |
workflow_dispatch: | |
jobs: | |
# Runs instrumented tests on a Pixel 6 API 34 emulator. | |
system-tests: | |
# This condition is necessary to avoid having an endless search for the bitdash runner occurring on the public repo which is not part of the bitmovin-engineering organization. | |
# Furthermore, we only needs these checks internally. | |
# Linked ticket: https://bitmovin.atlassian.net/browse/AN-4297 | |
# You can obtain this id by running the following command in the terminal while being on the repository page: | |
# $("meta[name=octolytics-dimension-repository_id]").getAttribute('content') | |
if: github.repository_id == 310696148 | |
# This job cannot run on the default runner, as it requires many resources. | |
runs-on: bitdash-4core | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Setup Android | |
uses: android-actions/setup-android@v3 | |
- 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: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: wrapper | |
cache-read-only: false | |
# Collector Test | |
- name: Tests Collector | |
if: always() | |
run: | | |
./gradlew :collector:pixel6api34DebugAndroidTest | |
# Collector Bitmovin Player Test | |
- name: Tests Collector Bitmovin Player | |
if: always() | |
run: | | |
./gradlew :collector-bitmovin-player:pixel6api34DebugAndroidTest | |
# Collector Exo Player Test | |
- name: Tests Collector Exoplayer | |
if: always() | |
run: | | |
./gradlew :collector-exoplayer:pixel6api34DebugAndroidTest | |
# Collector Media3 Exo Player Test | |
- name: Tests Collector Media3 Exoplayer | |
if: always() | |
run: | | |
./gradlew :collector-media3-exoplayer:pixel6api34DebugAndroidTest | |
## Collector Amazon IVS Test | |
- name: Tests Collector Amazon IVS | |
if: always() | |
run: | | |
./gradlew :collector-amazon-ivs:pixel6api34DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.notClass=com.bitmovin.analytics.amazon.ivs.TVBasicScenariosTest | |
# If it fails on the main branch, send a slack message (merged PR or nightly tests) | |
- name: Send a Slack message whenever the tests fails on the main branch | |
if: failure() && github.ref == 'refs/heads/main' | |
uses: slackapi/slack-github-action@v1 | |
with: | |
# The Slack Webhook URL only takes one parameter which is the link to the failed action. | |
payload: | | |
{ | |
"failedActionUrl": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
# Create Report which can be analyzed in the github ui directly | |
- name: Publish SystemTest Report | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() # always run even if the previous step fails | |
with: | |
report_paths: '**/build/outputs/androidTest-results/managedDevice/debug/pixel6api34/TEST-*.xml' | |
- name: Copying Reports | |
if: always() | |
id: copy-reports | |
run: | | |
mkdir reports | |
cp -r collector/build/reports/androidTests/managedDevice/debug/pixel6api34/ reports/collector | |
cp -r collector-bitmovin-player/build/reports/androidTests/managedDevice/debug/pixel6api34/ reports/collector-bitmovin-player | |
cp -r collector-exoplayer/build/reports/androidTests/managedDevice/debug/pixel6api34/ reports/collector-exoplayer | |
cp -r collector-media3-exoplayer/build/reports/androidTests/managedDevice/debug/pixel6api34/ reports/collector-media3-exoplayer | |
cp -r collector-amazon-ivs/build/reports/androidTests/managedDevice/debug/pixel6api34/ reports/collector-amazon-ivs | |
cp .github/tests-report/INDEX_TEST_REPORTS.html reports/index.html | |
./.github/tests-report/report_enhancer.sh reports | |
- name: Upload Reports | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: tests-report | |
path: reports |