Skip to content

Commit 0aedb1b

Browse files
Working on iOS GitHub CI
1 parent befa4de commit 0aedb1b

File tree

1 file changed

+90
-63
lines changed

1 file changed

+90
-63
lines changed

.github/workflows/pr_validation.yaml

Lines changed: 90 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,98 @@ name: Validate PR
33
on: [pull_request, workflow_dispatch]
44

55
jobs:
6-
test_flutter-test-runners_deep-links_android:
7-
runs-on: ubuntu-latest
8-
defaults:
9-
run:
10-
working-directory: ./packages/flutter_test_runners/example_deep_links
6+
# test_flutter-test-runners_deep-links_android:
7+
# runs-on: ubuntu-latest
8+
# defaults:
9+
# run:
10+
# working-directory: ./packages/flutter_test_runners/example_deep_links
11+
#
12+
# steps:
13+
# - name: Checkout Repository
14+
# uses: actions/checkout@v3
15+
#
16+
# # Need JDK 17 for Android build.
17+
# - name: Set up JDK 17
18+
# uses: actions/setup-java@v3
19+
# with:
20+
# distribution: 'temurin'
21+
# java-version: '17'
22+
#
23+
# # The Android emulator action seems to want to include this.
24+
# - name: enable KVM for linux runners
25+
# working-directory: ~
26+
# run: |
27+
# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
28+
# sudo udevadm control --reload-rules
29+
# sudo udevadm trigger --name-match=kvm
30+
#
31+
# - name: Set up Flutter
32+
# uses: subosito/flutter-action@v2
33+
# with:
34+
# channel: stable
35+
# architecture: x64
36+
#
37+
# - name: Install Flutter Dependencies
38+
# run: flutter pub get
39+
#
40+
# - name: Build Flutter App (Debug Mode)
41+
# # Must be debug mode so we can enable Flutter Driver.
42+
# run: flutter build apk --debug
43+
#
44+
# - name: Install Android SDK and launch emulator
45+
# uses: reactivecircus/android-emulator-runner@v2
46+
# with:
47+
# api-level: 35
48+
# target: default
49+
# arch: x86_64
50+
# profile: Galaxy Nexus
51+
# cores: 2
52+
# disk-size: 6000M
53+
# heap-size: 600M
54+
# sdcard-path-or-size: 100M
55+
# avd-name: github-ci-emulator
56+
# force-avd-creation: false
57+
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
58+
# disable-animations: false
59+
# script: |
60+
# echo "Running emulator..."
61+
# echo "Working directory: $(pwd)"
62+
#
63+
# echo "Unlocking the screen"
64+
# adb shell input keyevent 82 # Unlock the emulator screen if it's locked
65+
# echo ""
66+
#
67+
# echo "Installing the APK"
68+
# cd packages/flutter_test_runners/example_deep_links && flutter install --debug -d emulator-5554
69+
# echo ""
70+
#
71+
# echo "Running Flutter tests"
72+
# cd packages/flutter_test_runners/example_deep_links && flutter test test_driver/deep_link_android_test.dart
73+
74+
test_flutter-test-runners_deep-links_ios:
75+
runs-on: macos-latest
1176

1277
steps:
13-
- name: Checkout Repository
78+
- name: Checkout repository
1479
uses: actions/checkout@v3
1580

16-
# Need JDK 17 for Android build.
17-
- name: Set up JDK 17
18-
uses: actions/setup-java@v3
19-
with:
20-
distribution: 'temurin'
21-
java-version: '17'
81+
- name: Set up Xcode
82+
run: |
83+
sudo xcode-select -s /Applications/Xcode.app
84+
xcodebuild -version
2285
23-
# The Android emulator action seems to want to include this.
24-
- name: enable KVM for linux runners
25-
working-directory: ~
86+
- name: Create and Boot iOS Simulator
2687
run: |
27-
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
28-
sudo udevadm control --reload-rules
29-
sudo udevadm trigger --name-match=kvm
88+
# List available devices and runtimes
89+
xcrun simctl list devices
90+
xcrun simctl list runtimes
91+
92+
# Create a new simulator (if needed)
93+
SIMULATOR_ID=$(xcrun simctl create "GitHubActions-Simulator" "iPhone 14" "com.apple.CoreSimulator.SimRuntime.iOS-17-0")
94+
95+
# Boot the simulator
96+
xcrun simctl boot "$SIMULATOR_ID"
97+
xcrun simctl list devices booted
3098
3199
- name: Set up Flutter
32100
uses: subosito/flutter-action@v2
@@ -37,49 +105,8 @@ jobs:
37105
- name: Install Flutter Dependencies
38106
run: flutter pub get
39107

40-
- name: Build Flutter App (Debug Mode)
41-
# Must be debug mode so we can enable Flutter Driver.
42-
run: flutter build apk --debug
43-
44-
- name: Install Android SDK and launch emulator
45-
uses: reactivecircus/android-emulator-runner@v2
46-
with:
47-
api-level: 35
48-
target: default
49-
arch: x86_64
50-
profile: Galaxy Nexus
51-
cores: 2
52-
disk-size: 6000M
53-
heap-size: 600M
54-
sdcard-path-or-size: 100M
55-
avd-name: github-ci-emulator
56-
force-avd-creation: false
57-
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
58-
disable-animations: false
59-
script: |
60-
echo "Running emulator..."
61-
echo "Working directory: $(pwd)"
62-
63-
echo "Unlocking the screen"
64-
adb shell input keyevent 82 # Unlock the emulator screen if it's locked
65-
echo ""
66-
67-
echo "Installing the APK"
68-
cd packages/flutter_test_runners/example_deep_links && flutter install --debug -d emulator-5554
69-
echo ""
70-
71-
echo "Running Flutter tests"
72-
cd packages/flutter_test_runners/example_deep_links && flutter test test_driver/deep_link_android_test.dart
108+
- name: Build iOS App
109+
run: flutter build ios --debug
73110

74-
# - name: Wait for Emulator to Start
75-
# working-directory: ~
76-
# run: |
77-
# adb wait-for-device
78-
# adb shell input keyevent 82 # Unlock the emulator screen if it's locked
79-
#
80-
#
81-
# - name: Install App on Emulator
82-
# run: flutter install --debug
83-
#
84-
# - name: Run deep link tests
85-
# run: flutter test test_driver
111+
- name: Install iOS App
112+
run: flutter install ipa

0 commit comments

Comments
 (0)