fix: audio not playing intermittently in android #5383
Workflow file for this run
This file contains hidden or 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: Flutter Android | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "mobile-app/**" | |
- ".github/**" | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
flutter_test: | |
name: e2e Tests | |
defaults: | |
run: | |
working-directory: ./mobile-app | |
runs-on: ubuntu-latest | |
steps: | |
- name: Remove unused software | |
working-directory: / | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
echo "Free space:" | |
df -h / | |
- name: Checkout files | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Install SQLite libraries | |
run: sudo apt-get -y install libsqlite3-0 libsqlite3-dev | |
- 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@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3 | |
with: | |
gradle-version: 8.7 | |
- name: Setup Java 17 | |
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: AVD cache | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-34 | |
- name: Ceate AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2 | |
with: | |
api-level: 34 | |
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: false | |
script: echo "Generated AVD snapshot for caching." | |
- name: Setup Flutter 3.32.x | |
uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2 | |
with: | |
flutter-version: "3.32.x" | |
channel: "stable" | |
cache: true | |
cache-key: flutter-3.32.x | |
cache-path: ${{ runner.tool_cache }}/flutter | |
- name: Create .env file | |
run: | | |
echo "HASHNODE_PUBLICATION_ID=$HASHNODE_PUBLICATION_ID" > .env | |
echo "ALGOLIAAPPID=$ALGOLIA_APP_ID" >> .env | |
echo "ALGOLIAKEY=$ALGOLIA_KEY" >> .env | |
echo "AUTH0_DOMAIN=$AUTH0_DOMAIN" >> .env | |
echo "AUTH0_CLIENT_ID=$AUTH0_CLIENT_ID" >> .env | |
env: | |
HASHNODE_PUBLICATION_ID: ${{ secrets.HASHNODE_PUBLICATION_ID }} | |
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
ALGOLIA_KEY: ${{ secrets.ALGOLIA_KEY }} | |
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }} | |
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }} | |
- name: Install packages | |
run: flutter pub get | |
- name: Run tests in emulator | |
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2 | |
with: | |
api-level: 34 | |
target: google_apis | |
arch: x86_64 | |
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: cd mobile-app && if adb shell pm list packages | grep -q org.freecodecamp; then adb uninstall org.freecodecamp; fi && dart integration_test_runner.dart | |
- name: Upload screenshots | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
if: always() | |
with: | |
name: screenshots | |
path: mobile-app/screenshots/ | |
if-no-files-found: error | |
retention-days: 7 |