-
Notifications
You must be signed in to change notification settings - Fork 2
118 lines (113 loc) · 5.17 KB
/
runtime_bridge_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
name: runtime bridge integration tests
on:
pull_request:
branches:
- main
- release/*
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
ios:
runs-on: imhotep
steps:
- uses: actions/checkout@v4
- name: Get changed files of the enmeshed_runtime_bridge package
id: changed-enmeshed_runtime_bridge-files
uses: tj-actions/changed-files@v45
with:
files: packages/enmeshed_runtime_bridge/**
- name: Start Backbone
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
run: docker compose -f .dev/compose.backbone.yml --env-file .dev/compose.backbone.env up -d
- name: "List all simulators"
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
run: "xcrun xctrace list devices"
- name: "Start Simulator"
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
# the command "xcrun simctl boot" expects a device identifier
# the assignment of the UDID variable consists of retrieving the ID of the simulator
# by extracting it from the command "xcrun xctrace list devices"
run: |
UDID=$(xcrun xctrace list devices | grep -m 1 "^iPhone" | awk '{gsub(/[()]/,""); print $NF}')
echo $UDID
if xcrun simctl boot "$UDID" 2>errorFile.txt; then
echo "device booted"
else
if grep -q "Unable to boot device in current state: Booted" errorFile.txt; then
echo "device already booted"
rm errorFile.txt
else
echo "device not booted"
cat errorFile.txt
rm errorFile.txt
exit 1
fi
fi
- name: Setup Flutter SDK
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install Dependencies
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
run: |
dart pub global activate melos
melos bootstrap
- name: Run integration tests
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
run: cd packages/enmeshed_runtime_bridge/integration_test_runner && flutter test integration_test/suite_test.dart --dart-define=app_baseUrl=http://localhost:8090 --dart-define=app_clientId=test --dart-define=app_clientSecret=test
- name: Stop Backbone
run: docker compose -f .dev/compose.backbone.yml --env-file .dev/compose.backbone.env down -v
if: always()
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get changed files of the enmeshed_runtime_bridge package
id: changed-enmeshed_runtime_bridge-files
uses: tj-actions/changed-files@v45
with:
files: packages/enmeshed_runtime_bridge/**
- name: Start Backbone
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
run: docker compose -f .dev/compose.backbone.yml --env-file .dev/compose.backbone.env up -d
- name: Setup Java
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17
cache: "gradle"
- name: Setup Flutter SDK
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install Dependencies
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
run: |
dart pub global activate melos
melos bootstrap
- name: Enable KVM group perms
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
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: Start emulator and run tests
if: steps.changed-enmeshed_runtime_bridge-files.outputs.any_changed == 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
target: playstore
api-level: 32
force-avd-creation: false
avd-name: integration_test
disable-spellchecker: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
arch: x86_64
profile: pixel
script: cd packages/enmeshed_runtime_bridge/integration_test_runner && adb reverse tcp:8090 tcp:8090 && flutter test integration_test/suite_test.dart --dart-define=app_baseUrl=http://localhost:8090 --dart-define=app_clientId=test --dart-define=app_clientSecret=test
- name: Stop Backbone
run: docker compose -f .dev/compose.backbone.yml --env-file .dev/compose.backbone.env down -v
if: always()