e2e #858
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: 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.24.4 | |
jobs: | |
patch: | |
strategy: | |
fail-fast: false | |
matrix: | |
flutter-version: [3.24.1, 3.24.0, 3.22.3, 3.22.2, 3.19.6] | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
env: | |
SHOREBIRD_HOSTED_URL: https://api-dev.shorebird.dev | |
steps: | |
- name: 📚 Git Checkout | |
uses: actions/checkout@v4 | |
- 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@v4 | |
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: 🤖 AVD Cache | |
uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-29 | |
- 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 | |
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" | |
- name: 🧪 Run Patch E2E Tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
arch: x86_64 | |
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: 15 | |
env: | |
SHOREBIRD_HOSTED_URL: ${{ matrix.branch == 'stable' && 'https://api.shorebird.dev' || 'https://api-dev.shorebird.dev' }} | |
steps: | |
- name: 📚 Git Checkout | |
uses: actions/checkout@v4 | |
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@v4 | |
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 |