name: e2e concurrency: group: ${{ github.workflow }}-${{ github.ref }}-e2e cancel-in-progress: true on: workflow_dispatch: schedule: # At the end of every day - cron: "0 0 * * *" env: SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }} FLUTTER_VERSION: 3.41.9 jobs: patch: strategy: fail-fast: false matrix: flutter-version: [ 3.41.2, 3.38.9, 3.35.5, 3.35.4, 3.35.3, 3.35.2, 3.32.8, 3.32.7, 3.32.6, 3.32.5, 3.32.4, 3.32.3, 3.32.2, 3.32.1, 3.32.0, 3.29.3, 3.29.2, 3.29.1, 3.29.0, 3.27.2, 3.27.1, 3.27.0, 3.24.5, 3.24.4, 3.24.3, 3.24.1, 3.24.0, 3.22.3, 3.22.2, 3.19.6, ] runs-on: ubuntu-latest timeout-minutes: 30 env: SHOREBIRD_HOSTED_URL: https://api-dev.shorebird.dev steps: - name: ๐Ÿ“š Git Checkout uses: actions/checkout@v7 - name: ๐Ÿ–ฅ๏ธ Add Shorebird to PATH shell: bash run: echo "${GITHUB_WORKSPACE}/bin/" >> $GITHUB_PATH - name: ๐Ÿฆ Verify Shorebird Installation run: | if [[ $(shorebird --version) =~ "Engine โ€ข revision" ]]; then echo 'โœ… Shorebird CLI is installed!' else echo 'โŒ Shorebird CLI is not installed.' exit 1 fi shell: bash - name: โ˜• Set up Java uses: actions/setup-java@v5 with: distribution: "temurin" java-version: "17" - name: ๐ŸŽฏ Set up Flutter uses: subosito/flutter-action@v2 with: channel: stable flutter-version: ${{ matrix.flutter-version }} cache: true - name: ๐Ÿš€ Enable KVM for Linux Runners if: runner.os == 'Linux' 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: ๐Ÿค– AVD Cache uses: actions/cache@v6 id: avd-cache with: path: | ~/.android/avd/* ~/.android/adb* key: avd-29-${{ runner.os }}-${{ hashFiles('.github/workflows/e2e.yaml') }} - name: ๐Ÿค– Cache AVD Snapshot if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 with: api-level: 29 arch: x86_64 target: default force-avd-creation: false sdcard-path-or-size: 512M emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot disable-animations: false channel: canary script: echo "Generated AVD Snapshot" - name: ๐Ÿงช Run Patch E2E Tests uses: reactivecircus/android-emulator-runner@v2 with: api-level: 29 arch: x86_64 target: default script: ./scripts/patch_e2e.sh ${{ matrix.flutter-version }} cli: strategy: fail-fast: false matrix: os: [macos-latest, windows-latest, ubuntu-latest] branch: [stable, main] runs-on: ${{ matrix.os }} timeout-minutes: 20 env: SHOREBIRD_HOSTED_URL: ${{ matrix.branch == 'stable' && 'https://api.shorebird.dev' || 'https://api-dev.shorebird.dev' }} steps: - name: ๐Ÿ“š Git Checkout uses: actions/checkout@v7 with: ref: ${{ matrix.branch }} - name: ๐Ÿ–ฅ๏ธ Add Shorebird to macOS/Linux PATH shell: bash if: runner.os != 'Windows' run: echo "${GITHUB_WORKSPACE}/bin/" >> $GITHUB_PATH - name: ๐Ÿ–ฅ๏ธ Add Shorebird to Windows PATH shell: pwsh if: runner.os == 'Windows' run: Add-Content $env:GITHUB_PATH "${env:GITHUB_WORKSPACE}\bin" - name: ๐Ÿฆ Verify Shorebird Installation (macOS / Linux) if: runner.os != 'Windows' run: | if [[ $(shorebird --version) =~ "Engine โ€ข revision" ]]; then echo 'โœ… Shorebird CLI is installed!' else echo 'โŒ Shorebird CLI is not installed.' exit 1 fi shell: bash - name: ๐Ÿฆ Verify Shorebird Installation (Windows) if: runner.os == 'Windows' run: | $shorebird_version = shorebird --version if ($shorebird_version -match "Engine") { Write-Output "โœ… Shorebird CLI is installed!" } else { Write-Output "โŒ Shorebird CLI is not installed." exit 1 } shell: pwsh - name: โ˜• Set up Java uses: actions/setup-java@v5 with: distribution: "temurin" java-version: "17" - name: ๐ŸŽฏ Set up Flutter uses: subosito/flutter-action@v2 with: channel: stable flutter-version: ${{ env.FLUTTER_VERSION }} cache: true - name: ๐Ÿงช Run Integration Tests run: dart test integration_test working-directory: packages/shorebird_cli