-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (101 loc) · 3.43 KB
/
ci.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
#
# Flowmotion
# CI/CD Pipeline
#
name: Flowmotion CI/CD
on:
push: {}
jobs:
mobile-android:
name: Build & Test Mobile App (Android)
runs-on: ubuntu-22.04
env:
ANDROID_API_LEVEL: 23
steps:
- uses: actions/checkout@v4
- name: Setup Gradle build cache
uses: gradle/actions/setup-gradle@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
- name: Build Android APK
run: flutter build apk
- name: Upload Android APK
uses: actions/upload-artifact@v4
with:
name: flowmotion-debug.apk
path: build/app/outputs/flutter-apk/app-debug.apk
# setup android emulator for testing
- name: Enable KVM for Android emulator
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: Setup AVD emulator cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.ANDROID_API_LEVEL }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.ANDROID_API_LEVEL }}
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 for caching."
- name: Write test_auth_info.dart secrets
run: printf "${{ secrets.TEST_AUTH_INFO_B64 }}" | base64 -d > test_auth_info.dart
- name: Test Mobile App (Android)
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.ANDROID_API_LEVEL }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: flutter drive --driver=test_driver/integration_driver.dart --target=integration_test/main.dart
pipeline:
strategy:
fail-fast: false
matrix:
target: [lint, test]
name: "${{ matrix.target }} Pipeline"
defaults:
run:
working-directory: pipeline
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10.13"
# cache pip dependencies
cache: "pip"
- name: Install Pip dependencies
run: pip install -r requirements.txt
- name: "${{ matrix.target }} Pipeline"
run: "make ${{ matrix.target }}"
schema:
name: "Validate JSON Schema"
runs-on: ubuntu-22.04
defaults:
run:
working-directory: schema
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.9.x
# cache npm dependencies
cache: npm
cache-dependency-path: schema/package-lock.json
- name: Install npm dependencies
run: npm ci
- name: Validate json schema
run: npx ajv compile -s "*.schema.json" --spec=draft2020 -c ajv-formats