release(app): v6.0.1+60001 #2945
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: CI - Mobile curriculum test | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "mobile-app/**" | |
- ".github/**" | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
mobile-test: | |
name: Test curriculum for mobile app | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
gradle-version: [8.7] | |
java-version: [17] | |
android-api-level: [35] | |
pnpm-version: [10] | |
flutter-version: ["3.32.x"] | |
steps: | |
- name: Remove unused software | |
working-directory: / | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
echo "Free space:" | |
df -h / | |
- 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 - ${{ matrix.gradle-version }} | |
uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 # v3 | |
with: | |
gradle-version: ${{ matrix.gradle-version }} | |
- name: Setup Java - ${{ matrix.java-version }} | |
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4 | |
with: | |
distribution: "temurin" | |
java-version: ${{ matrix.java-version }} | |
- name: AVD cache - ${{ matrix.android-api-level }} | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{ matrix.android-api-level }} | |
- name: Create AVD and generate snapshot for caching - ${{ matrix.android-api-level }} | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2 | |
with: | |
api-level: ${{ matrix.android-api-level }} | |
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: Checkout freeCodeCamp main repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
repository: freeCodeCamp/freeCodeCamp | |
path: freeCodeCamp | |
- name: Checkout mobile repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
path: mobile | |
- name: Setup pnpm - ${{ matrix.pnpm-version }} | |
uses: pnpm/action-setup@v2 | |
with: | |
version: ${{ matrix.pnpm-version }} | |
- name: Setup Flutter - ${{ matrix.flutter-version }} | |
uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046 # v2 | |
with: | |
flutter-version: ${{ matrix.flutter-version }} | |
channel: "stable" | |
cache: true | |
cache-key: flutter-${{ matrix.flutter-version }} | |
cache-path: ${{ runner.tool_cache }}/flutter | |
- name: Set freeCodeCamp Environment Variables | |
working-directory: freeCodeCamp | |
run: | | |
cp sample.env .env | |
echo "SHOW_UPCOMING_CHANGES=true" >> .env | |
- name: Create dummy mobile app .env file | |
working-directory: mobile/mobile-app | |
run: touch .env | |
- name: Install and Build Curriculum | |
working-directory: freeCodeCamp | |
run: | | |
pnpm install | |
pnpm run create:shared | |
pnpm run build:curriculum | |
pnpm run clean:packages | |
- name: Install mobile app dependencies | |
working-directory: mobile/mobile-app | |
run: flutter pub get | |
- name: Run curriculum tests in emulator - ${{ matrix.android-api-level }} | |
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # v2 | |
with: | |
api-level: ${{ matrix.android-api-level }} | |
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/mobile-app && if adb shell pm list packages | grep -q org.freecodecamp; then adb uninstall org.freecodecamp; fi && dart integration_test_runner.dart --curriculum ${RUNNER_DEBUG:+--debug} | |
- name: Upload failed tests logs | |
if: failure() | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
with: | |
name: test_runner_results.txt | |
path: mobile/mobile-app/integration_test/test_runner/test_runner_results.txt | |
if-no-files-found: error | |
retention-days: 7 |