-
Notifications
You must be signed in to change notification settings - Fork 36
136 lines (111 loc) · 3.41 KB
/
Copy pathflutter-ci.yml
File metadata and controls
136 lines (111 loc) · 3.41 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
name: Flutter CI
on:
push:
branches:
- master
paths-ignore:
- "**/*.md"
- ".github/**"
pull_request:
branches:
- master
paths-ignore:
- "**/*.md"
- ".github/**"
workflow_dispatch:
env:
FLUTTER_VERSION: 3.24.0
PANA_VERSION: 0.22.8
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v6
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: 📦 Install Additional Tooling
# Add additional Flutter tooling
run: |
dart pub global activate pana ${{ env.PANA_VERSION }}
- name: ✂ Format Code
run: dart format --set-exit-if-changed .
- name: 📊 Analyze Code
run: flutter analyze --fatal-infos --fatal-warnings .
- name: 🔎 Pana Check
run: pana --no-warning
test:
runs-on: ubuntu-latest
needs: lint
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v6
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: 🧪 Run Tests
run: flutter test
build-android:
runs-on: ubuntu-latest
needs: test
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v6
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: 🤖 Build Android app
working-directory: example
run: flutter build apk --release
build-ios:
runs-on: macos-latest
needs: test
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v6
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: 🍎 Build iOS app
working-directory: example
run: flutter build ios --release --no-codesign
# Exercises the Swift Package Manager integration path, which the CocoaPods
# `build-ios` job never reads (SPM is opt-in behind a feature flag). Uses a
# throwaway consumer app instead of the example app: a plain consumer never
# gets Flutter's example-only local package override, so it builds regardless
# of the checkout directory name (the example app would require the checkout
# dir to be named `freerasp`). FlutterFramework SwiftPM package requires 3.41.0+.
build-ios-spm:
runs-on: macos-latest
needs: test
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v6
- name: 🐦 Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.44.0
cache: true
- name: 📦 Enable Swift Package Manager
run: flutter config --enable-swift-package-manager
- name: 🍎 Build iOS consumer app with SPM
run: |
set -euo pipefail
flutter create --platforms=ios "$RUNNER_TEMP/spm_consumer"
cd "$RUNNER_TEMP/spm_consumer"
flutter pub add freerasp --path "$GITHUB_WORKSPACE"
flutter build ios --release --no-codesign