167 lines
4.8 KiB
YAML
167 lines
4.8 KiB
YAML
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.27.1
|
|
|
|
jobs:
|
|
patch:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
flutter-version: [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: 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: 🚀 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@v4
|
|
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: 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
|