-
Notifications
You must be signed in to change notification settings - Fork 1
147 lines (120 loc) · 4.18 KB
/
integration-tests.yml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Integration Tests
on:
pull_request:
branches: [ "main" ]
jobs:
web-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.1'
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: |
cd proxy-server
npm install
cd ../..
flutter pub get
working-directory: ./integrationtestapp
- name: Set up Google Chrome and ChromeDriver
uses: browser-actions/setup-chrome@v1
with:
chrome-version: 129
install-chromedriver: true
install-dependencies: true
- name: Start Xvfb
run: |
sudo apt-get install -y xvfb
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
- name: Start ChromeDriver
run: |
nohup chromedriver --port=4444 &
sleep 5
- name: Start Proxy Server
run: |
nohup node integrationtestapp/proxy-server/proxy_server.js &
sleep 5
env:
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
- name: Run Web tests with XVFB
run: |
for test in integration_test/*.dart; do
xvfb-run --auto-servernum --server-args="-screen 0 1280x1024x24" flutter drive --driver=test_driver/integration_test.dart --target=$test -d chrome --web-port=4200 --dart-define=MAILOSAUR_API_KEY=${{ secrets.MAILOSAUR_API_KEY }}
done
working-directory: ./integrationtestapp
env:
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
android-tests:
runs-on: ubuntu-latest
needs: web-tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.1'
- name: Enable KVM
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: Install dependencies
run: flutter pub get
working-directory: ./integrationtestapp
- name: Set environment variables
env:
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}
run: |
echo "export MAILOSAUR_API_KEY=${{ secrets.MAILOSAUR_API_KEY }}" >> $GITHUB_ENV
- name: Start emulator and run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis
build-tools: 34.0.0
arch: x86_64
profile: Nexus 6
working-directory: ./integrationtestapp
script: flutter test integration_test/*.dart -d emulator-5554 --dart-define=MAILOSAUR_API_KEY=${{ secrets.MAILOSAUR_API_KEY }}
ios-tests:
runs-on: macos-latest
needs: android-tests
steps:
- uses: actions/checkout@v4
- name: Set up Xcode 15.4
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.1'
- name: Install dependencies
run: flutter pub get
working-directory: ./integrationtestapp
- name: Install CocoaPods
run: pod install --project-directory=ios
working-directory: ./integrationtestapp
- name: Install simulator
id: install-simulator
uses: futureware-tech/simulator-action@v3
with:
model: 'iPhone 14'
- name: Run iOS tests
run: flutter test integration_test/*.dart -d ${{ steps.install-simulator.outputs.udid }} --dart-define=MAILOSAUR_API_KEY=${{ secrets.MAILOSAUR_API_KEY }}
working-directory: ./integrationtestapp
env:
MAILOSAUR_API_KEY: ${{ secrets.MAILOSAUR_API_KEY }}