-
Notifications
You must be signed in to change notification settings - Fork 147
112 lines (94 loc) · 3.06 KB
/
patch_e2e.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: patch_e2e
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
workflow_dispatch:
schedule:
# At the end of every day
- cron: "0 0 * * *"
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest]
branch: [main]
runs-on: ${{ matrix.os }}
env:
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
SHOREBIRD_HOSTED_URL: ${{ matrix.branch == 'stable' && 'https://api.shorebird.dev' || 'https://api-dev.shorebird.dev' }}
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v3
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@v3
with:
distribution: "temurin"
java-version: "17"
- name: 🎯 Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.10.6
- name: AVD Cache
uses: actions/cache@v3
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
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: Create Flutter App
run: flutter create e2e_test --empty
- name: Shorebird Init
run: shorebird init --force -v
- name: Shorebird Release
run: shorebird release android --force -v
- name: E2E Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: shorebird run -d android -v
working-directory: ./e2e_test