Slow Tests #582
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: Slow Tests | |
on: | |
schedule: | |
# "High load times include the start of every hour. | |
# To decrease the chance of delay, schedule your workflow to run | |
# at a different time of the hour." | |
# We pick 8:25 UTC, aiming for "later than PST/UTC-8 night work" and | |
# "earlier than ADT/UTC-3 morning work". | |
- cron: '25 8 * * *' | |
workflow_dispatch: {} # no parameters | |
jobs: | |
check-up-to-date: | |
name: Already up to date? | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'signalapp' && endsWith(github.repository, '-private') }} | |
outputs: | |
has-changes: ${{ steps.check.outputs.has-changes }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: git log --after '24 hours ago' --exit-code || echo 'has-changes=true' >> $GITHUB_OUTPUT | |
id: check | |
android: | |
name: Build for Android | |
runs-on: ubuntu-latest | |
needs: [check-up-to-date] | |
if: ${{ always() && (needs.check-up-to-date.outputs.has-changes || github.event_name != 'schedule') }} | |
steps: | |
- name: Install protoc | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal --target aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,i686-linux-android | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- run: bin/fetch-artifact -p android | |
- run: bin/build-aar --release --ringrtc-only | |
- name: Upload libraries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libs | |
path: out/release/libs/* | |
retention-days: 2 | |
android-emulator-tests: | |
name: Android Emulator Tests | |
# For hardware acceleration; see https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ | |
runs-on: ubuntu-latest-4-cores | |
needs: [android] | |
if: ${{ always() && needs.android.result == 'success' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86, x86_64] | |
steps: | |
# For hardware acceleration; see https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/ | |
- name: Enable KVM group perms | |
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 | |
- uses: actions/checkout@v4 | |
- name: Download JNI libraries | |
id: download | |
uses: actions/download-artifact@v4 | |
with: | |
name: libs | |
path: out/release/libs | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 17 | |
# From reactivecircus/android-emulator-runner | |
- name: AVD cache | |
uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{ matrix.arch }}-21-linux | |
- name: Create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # v2.32.0 | |
with: | |
arch: ${{ matrix.arch }} | |
api-level: 21 | |
force-avd-creation: false | |
emulator-options: -no-window -noaudio -no-boot-anim | |
script: echo "Generated AVD snapshot for caching." | |
- name: Run tests | |
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # v2.32.0 | |
with: | |
arch: ${{ matrix.arch }} | |
api-level: 21 | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -noaudio -no-boot-anim | |
# It is correct that we use *debug*RingrtcLibDir below (specified by connectedCheck), | |
# even though we are using *release* artifacts. | |
script: ./gradlew ringrtc:android:connectedCheck -PdebugRingrtcLibDir=${{ github.workspace }}/out/release/libs -PwebrtcJar=${{ github.workspace }}/out/release/libs/libwebrtc.jar | |
ios: | |
name: Build for all iOS targets | |
runs-on: macos-13 | |
needs: [check-up-to-date] | |
if: ${{ always() && (needs.check-up-to-date.outputs.has-changes || github.event_name != 'schedule') }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: brew install protobuf coreutils # for grealpath | |
- run: rustup toolchain install $(cat rust-toolchain) --profile minimal --target x86_64-apple-ios,aarch64-apple-ios,aarch64-apple-ios-sim --component rust-src | |
- run: cargo install cbindgen | |
- run: sudo xcodes select 15.2 | |
- run: bin/fetch-artifact -p ios | |
- run: bin/build-ios --release --ringrtc-only | |
report_failures: | |
name: Report Failures | |
runs-on: ubuntu-latest | |
needs: [android, android-emulator-tests, ios] | |
if: ${{ failure() && github.event_name == 'schedule' }} | |
permissions: | |
# createCommitComment is supposed to only need the default 'read' permissions... | |
# ...but maybe it's different for private repositories. | |
contents: write | |
steps: | |
- uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.repos.createCommitComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
commit_sha: context.sha, | |
body: 'Failed Slow Tests: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>' | |
}) |