-
Notifications
You must be signed in to change notification settings - Fork 1
179 lines (172 loc) · 5.64 KB
/
Copy pathbuild.yaml
File metadata and controls
179 lines (172 loc) · 5.64 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
169
170
171
172
173
174
175
176
177
178
179
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Run test and build
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-dart:
name: Run dart unit tests
timeout-minutes: 45
runs-on:
labels: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- name: Setup flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2
with:
flutter-version: "3.38.x"
channel: "stable"
cache: true
- name: Setup melos
uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
with:
melos-version: "6.3.2"
- name: "Run flutter test"
run: melos run test:dart
test-android:
name: Run Android native unit tests
timeout-minutes: 45
runs-on:
labels: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- name: Setup flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2
with:
flutter-version: "3.38.x"
channel: "stable"
cache: true
- name: Setup melos
uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
with:
melos-version: "6.3.2"
- name: "Run Android native unit tests"
run: melos run test:android
test-ios:
name: Run iOS native unit tests
timeout-minutes: 45
runs-on:
labels: macos-latest-xlarge
env:
working_directory: "example"
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2
with:
flutter-version: "3.38.x"
channel: "stable"
cache: true
- name: Setup melos
uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
with:
melos-version: "6.3.2"
- name: Cache podfiles
uses: actions/cache@v4
with:
path: "**/Pods"
key: ${{ runner.os }}-pods-${{ hashFiles('**/*.podspec') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Select XCode 26.3
run: sudo xcode-select -s '/Applications/Xcode_26.3.0.app/Contents/Developer'
- name: Generate necessary files with flutter build
working-directory: ${{ env.working_directory }}
run: flutter build ios --config-only
- name: "Run iOS native unit tests"
run: TEST_DEVICE='iPhone 16 Pro' TEST_OS='26.2' melos run test:ios
build-android:
name: Build Android
needs: [test-dart, test-android]
if: contains(github.base_ref, 'main')
timeout-minutes: 45
runs-on:
labels: ubuntu-latest
env:
MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- name: Setup flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2
with:
flutter-version: "3.38.x"
channel: "stable"
cache: true
- name: Setup melos
uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
with:
melos-version: "6.3.2"
- name: "Run build for Android"
run: melos run flutter-build-android
build-ios:
name: Build iOS
needs: [test-dart, test-ios]
if: contains(github.base_ref, 'main')
timeout-minutes: 90
runs-on: macos-latest-xlarge
env:
MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Setup flutter
uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2
with:
flutter-version: "3.38.x"
channel: "stable"
cache: true
architecture: x64
- name: Setup melos
uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
with:
melos-version: "6.3.2"
- name: Cache podfiles
uses: actions/cache@v4
with:
path: "**/Pods"
key: ${{ runner.os }}-pods-${{ hashFiles('**/*.podspec') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Select XCode 26.3
run: sudo xcode-select -s '/Applications/Xcode_26.3.0.app/Contents/Developer'
- name: "Run build for iOS"
run: melos run flutter-build-ios