@@ -11,8 +11,14 @@ concurrency:
1111 group : ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}}
1212 cancel-in-progress : true
1313
14+ env :
15+ CELEST : ${{ github.workspace }}/apps/cli/bin/celest.dart
16+ defaults :
17+ run :
18+ shell : bash
19+
1420jobs :
15- build :
21+ test :
1622 runs-on : macos-latest-xlarge
1723 timeout-minutes : 15
1824 steps :
@@ -39,12 +45,180 @@ jobs:
3945 # - name: Test
4046 # working-directory: packages/celest_auth
4147 # run: dart test
42- - name : Test (Example)
43- working-directory : packages/celest_auth/example/celest
44- run : dart test
45- - name : Build Example (iOS)
48+ test_darwin :
49+ needs : [test]
50+ runs-on : macos-latest-xlarge
51+ timeout-minutes : 20
52+ steps :
53+ - name : Git Checkout
54+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
55+ - name : Setup Flutter
56+ uses : subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # 2.18.0
57+ with :
58+ cache : true
59+ - name : Get Packages
60+ working-directory : apps/cli
61+ run : dart pub get
62+ - name : Get Packages (Example)
63+ working-directory : packages/celest_auth/example
64+ run : flutter pub get
65+ - name : Setup iOS Simulator
66+ run : |
67+ RUNTIME=$(xcrun simctl list runtimes | grep 'iOS 18' | tail -n 1 | cut -d' ' -f 7)
68+ echo "Using runtime: $RUNTIME"
69+ xcrun simctl create ios 'iPhone 16 Pro Max' $RUNTIME
70+ echo "Booting simulator"
71+ xcrun simctl boot ios
72+ echo "Booted simulator"
73+ - name : Integration Test (iOS)
74+ working-directory : packages/celest_auth/example
75+ run : dart run $CELEST start --verbose -- flutter test -d ios integration_test
76+ - name : Integration Test (macOS)
4677 working-directory : packages/celest_auth/example
47- run : flutter build ios --no-codesign
48- - name : Build Example (Web)
78+ run : dart run $CELEST start --verbose -- flutter test -d macos integration_test
79+ # TODO: Keeps timing out on Linux. Fails hard on macOS...
80+ # test_android:
81+ # needs: [test]
82+ # runs-on: macos-latest-xlarge
83+ # timeout-minutes: 30
84+ # steps:
85+ # - name: Git Checkout
86+ # uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
87+ # - name: Setup Flutter
88+ # uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # 2.18.0
89+ # with:
90+ # cache: true
91+ # - name: Get Packages
92+ # working-directory: apps/cli
93+ # run: dart pub get
94+ # - name: Get Packages (Example)
95+ # working-directory: packages/celest_auth/example
96+ # run: flutter pub get
97+ # - name: Start Celest
98+ # working-directory: packages/celest_auth/example
99+ # run: dart run $CELEST start --verbose &
100+ # - name: Build APK
101+ # working-directory: packages/celest_auth/example
102+ # run: flutter build apk --debug
103+ # # - name: Enable KVM
104+ # # run: |
105+ # # echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
106+ # # sudo udevadm control --reload-rules
107+ # # sudo udevadm trigger --name-match=kvm
108+ # - name: Test (API 31)
109+ # uses: ReactiveCircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # 2.33.0
110+ # with:
111+ # # Matches `package:jni` compileSdkVersion
112+ # # https://github.com/dart-lang/native/blob/001910c9f40d637cb25c19bb500fb89cebdf7450/pkgs/jni/android/build.gradle#L57C23-L57C25
113+ # api-level: 31
114+ # arch: arm64-v8a
115+ # working-directory: packages/celest_auth/example
116+ # script: flutter test -d emulator integration_test
117+ # - name: Test (API 21)
118+ # uses: ReactiveCircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # 2.33.0
119+ # with:
120+ # # Minimum supported API level
121+ # # Should match build.gradle: https://github.com/celest-dev/celest/blob/main/packages/native/storage/android/build.gradle#L49
122+ # api-level: 21
123+ # arch: arm64-v8a
124+ # working-directory: packages/celest_auth/example
125+ # script: flutter test -d emulator integration_test
126+ test_linux :
127+ needs : [test]
128+ runs-on : ubuntu-latest
129+ timeout-minutes : 15
130+ steps :
131+ - name : Git Checkout
132+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
133+ - name : Setup Flutter
134+ uses : subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # 2.18.0
135+ with :
136+ cache : true
137+ - name : Install Build Dependencies
138+ run : |
139+ sudo apt-get update && \
140+ sudo apt-get install -y clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
141+ - name : Setup Test Environment
142+ run : tool/setup-ci.sh
143+ - name : Get Packages
144+ working-directory : apps/cli
145+ run : dart pub get
146+ - name : Get Packages (Example)
49147 working-directory : packages/celest_auth/example
50- run : flutter build web
148+ run : flutter pub get
149+ - name : Integration Test (Linux)
150+ working-directory : packages/celest_auth/example
151+ run : |
152+ # Headless tests require virtual display for the linux tests to run.
153+ export DISPLAY=:99
154+ sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
155+ dart run $CELEST start --verbose -- flutter test -d linux integration_test
156+ test_windows :
157+ needs : [test]
158+ runs-on : windows-latest
159+ timeout-minutes : 15
160+ steps :
161+ - name : Git Checkout
162+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
163+ - name : Setup Flutter
164+ uses : subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # 2.18.0
165+ with :
166+ cache : true
167+ - name : Get Packages
168+ working-directory : apps/cli
169+ run : dart pub get
170+ - name : Get Packages (Example)
171+ working-directory : packages/celest_auth/example
172+ run : flutter pub get
173+ - name : Test (Windows)
174+ working-directory : packages/celest_auth/example
175+ run : dart run "$CELEST" start --verbose -- flutter test -d windows integration_test
176+ test_web :
177+ needs : [test]
178+ runs-on : ubuntu-latest
179+ timeout-minutes : 10
180+ steps :
181+ - name : Git Checkout
182+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
183+ - name : Setup Flutter
184+ uses : subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff # 2.18.0
185+ with :
186+ cache : true
187+ - name : Setup Chromedriver
188+ uses : nanasess/setup-chromedriver@v2
189+ - name : Get Packages
190+ working-directory : apps/cli
191+ run : dart pub get
192+ - name : Get Packages (Example)
193+ working-directory : packages/celest_auth/example
194+ run : flutter pub get
195+ - name : Start Chromedriver
196+ run : |
197+ # Headless tests require virtual display for the chromedriver tests to run.
198+ export DISPLAY=:99
199+ sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
200+
201+ chromedriver --port=4444 &
202+ - name : Test (Web/JS)
203+ working-directory : packages/celest_auth/example
204+ run : |
205+ dart run "$CELEST" start --verbose -- \
206+ flutter drive \
207+ --driver=test_driver/integration_test.dart \
208+ --target=integration_test/integration_test.dart \
209+ -d web-server \
210+ --debug \
211+ --browser-name=chrome \
212+ --no-headless
213+ - name : Test (Web/WASM)
214+ working-directory : packages/celest_auth/example
215+ run : |
216+ dart run "$CELEST" start --verbose -- \
217+ flutter drive \
218+ --driver=test_driver/integration_test.dart \
219+ --target=integration_test/integration_test.dart \
220+ -d web-server \
221+ --debug \
222+ --browser-name=chrome \
223+ --no-headless \
224+ --wasm
0 commit comments