Repository navigation
168 lines (132 loc) · 4.57 KB
/
Copy pathci.yml
File metadata and controls
168 lines (132 loc) · 4.57 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: CI
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
FLUTTER_VERSION: "3.29.3"
jobs:
dart:
name: Dart
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
with:
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Flutter version
run: flutter --version
- name: Get package dependencies
run: flutter pub get
- name: Get example dependencies
working-directory: example
run: flutter pub get
- name: Check package versions
run: bash tool/check_versions.sh
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
- name: Analyze
run: flutter analyze
- name: Analyze example
working-directory: example
run: flutter analyze
- name: Test package
run: flutter test --coverage
- name: Test example
working-directory: example
run: flutter test
- name: Publish dry run
run: dart pub publish --dry-run
android:
name: Android
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Java
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: temurin
java-version: "17"
- name: Set up Flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
with:
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Cache Gradle
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('android/**/*.gradle', 'android/**/*.gradle.kts', 'example/android/**/*.gradle', 'example/android/**/*.gradle.kts', 'example/android/gradle/wrapper/gradle-wrapper.properties', 'example/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install Android packages
run: |
set -euo pipefail
SDKMANAGER="${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager"
if [[ ! -x "$SDKMANAGER" ]]; then
SDKMANAGER="$(find "$ANDROID_HOME" -path "*/bin/sdkmanager" -type f | head -n 1)"
fi
if [[ -z "$SDKMANAGER" || ! -x "$SDKMANAGER" ]]; then
echo "sdkmanager not found under ANDROID_HOME=$ANDROID_HOME"
exit 1
fi
set +o pipefail
yes | "$SDKMANAGER" --licenses
set -o pipefail
"$SDKMANAGER" "platforms;android-36" "ndk;27.0.12077973"
- name: Build example APK
working-directory: example
run: flutter build apk --debug
- name: Test Android plugin
working-directory: example/android
run: ./gradlew :plaid_link_flutter:testDebugUnitTest
ios:
name: iOS
runs-on: macos-15
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2
with:
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Verify LinkKit framework
run: bash tool/validate_linkkit.sh
- name: Get example dependencies
working-directory: example
run: flutter pub get
- name: Lint podspec
working-directory: ios
run: pod lib lint plaid_link_flutter.podspec --allow-warnings --skip-import-validation --no-clean
- name: Build iOS simulator example
working-directory: example
run: flutter build ios --simulator --no-codesign
- name: Run iOS unit tests
working-directory: example
run: |
xcodebuild test \
-workspace ios/Runner.xcworkspace \
-scheme Runner \
-destination 'platform=iOS Simulator,name=iPhone 16' \
-only-testing:RunnerTests \
CODE_SIGNING_ALLOWED=NO