Skip to content

Commit c978b0f

Browse files
authored
ci: improve ci (#37)
- add concurrency rules to workflows - pin flutter version to 3.19.x in CI - install swiftformat only if cache was not hit - update actions cache from v3 to v4 - ci: use ubuntu-latest instead of ubuntu-latest-8core
1 parent 10b2bf7 commit c978b0f

File tree

4 files changed

+94
-73
lines changed

4 files changed

+94
-73
lines changed

.github/workflows/analyze.yaml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,75 +19,82 @@ on:
1919
branches:
2020
- main
2121

22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
2226
jobs:
2327
flutter-analyze:
2428
timeout-minutes: 45
2529
runs-on: ubuntu-latest
2630
steps:
27-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
31+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
2832
- name: Override nav sdk dependencies
2933
uses: ./.github/actions/dependency-override
3034
with:
3135
NAV_SDK_DEPLOY_KEY: ${{ secrets.NAV_SDK_GIT_REPO_DEPLOY_KEY }}
3236
NAV_SDK_DEPENDENCY_OVERRIDE: ${{ secrets.NAV_SDK_OVERRIDE }}
33-
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
37+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
3438
with:
35-
channel: 'stable'
39+
flutter-version: "3.19.x"
40+
channel: "stable"
3641
cache: true
3742
- uses: bluefireteam/melos-action@720a109b686f61979b4f9f0d14f582ab1637647e
3843
with:
39-
melos-version: '3.0.1'
40-
- name: 'Run Flutter Analyze'
44+
melos-version: "3.0.1"
45+
- name: "Run Flutter Analyze"
4146
run: melos run flutter-analyze
4247

4348
format:
4449
runs-on: ubuntu-latest
4550
timeout-minutes: 20
4651
steps:
47-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
52+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
4853
- uses: actions/setup-java@v4
4954
with:
50-
distribution: 'temurin'
51-
java-version: '17'
55+
distribution: "temurin"
56+
java-version: "17"
5257
- name: Restore Cache
5358
uses: actions/cache/restore@v4
5459
id: cache
5560
with:
5661
path: /home/linuxbrew/.linuxbrew
57-
key: ${{ runner.os }}-linuxbrew-
62+
key: ${{ runner.os }}-linuxbrew
5863
- uses: Homebrew/actions/setup-homebrew@master
59-
- name: 'Install swiftformat v0.53'
64+
- name: "Install swiftformat v0.53"
65+
if: steps.cache.outputs.cache-hit != 'true'
6066
run: |
6167
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
6268
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/86f85aaa82beba49f8a5aabf3a22508c9249f188/Formula/s/swiftformat.rb
6369
grep -qxF 'brew "swiftformat.rb"' Brewfile || echo 'brew "swiftformat.rb"' >> Brewfile
6470
brew bundle --force
6571
- name: Save Cache
6672
uses: actions/cache/save@v4
67-
if: endsWith(steps.cache.outputs.cache-matched-key,hashFiles('Brewfile.lock.json')) == false
73+
if: steps.cache.outputs.cache-hit != 'true'
6874
with:
6975
path: /home/linuxbrew/.linuxbrew
70-
key: ${{ runner.os }}-linuxbrew-${{ hashFiles('Brewfile.lock.json') }}
76+
key: ${{ runner.os }}-linuxbrew
7177
- name: Override nav sdk dependencies
7278
uses: ./.github/actions/dependency-override
7379
with:
7480
NAV_SDK_DEPLOY_KEY: ${{ secrets.NAV_SDK_GIT_REPO_DEPLOY_KEY }}
7581
NAV_SDK_DEPENDENCY_OVERRIDE: ${{ secrets.NAV_SDK_OVERRIDE }}
76-
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
82+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
7783
with:
78-
channel: 'stable'
84+
flutter-version: "3.19.x"
85+
channel: "stable"
7986
cache: true
8087
- uses: bluefireteam/melos-action@720a109b686f61979b4f9f0d14f582ab1637647e
8188
with:
82-
melos-version: '3.0.1'
83-
- name: 'Formatter version'
89+
melos-version: "3.0.1"
90+
- name: "Formatter version"
8491
run: |
8592
swiftformat --version
86-
- name: 'Run format'
93+
- name: "Run format"
8794
if: ${{ success() || failure() }}
8895
run: |
8996
melos run format
90-
- name: 'Validate formatting'
97+
- name: "Validate formatting"
9198
if: ${{ success() || failure() }}
9299
run: |
93100
./.github/workflows/scripts/validate-formatting.sh

.github/workflows/build.yaml

Lines changed: 56 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -19,152 +19,158 @@ on:
1919
branches:
2020
- main
2121

22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
2226
jobs:
2327
test-dart:
2428
timeout-minutes: 45
25-
runs-on:
26-
labels: ubuntu-latest-8core
29+
runs-on:
30+
labels: ubuntu-latest
2731
steps:
28-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
32+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
2933
- name: Override nav sdk dependencies
3034
uses: ./.github/actions/dependency-override
3135
with:
3236
NAV_SDK_DEPLOY_KEY: ${{ secrets.NAV_SDK_GIT_REPO_DEPLOY_KEY }}
3337
NAV_SDK_DEPENDENCY_OVERRIDE: ${{ secrets.NAV_SDK_OVERRIDE }}
3438
- uses: actions/setup-java@v4
3539
with:
36-
distribution: 'temurin'
37-
java-version: '17'
38-
cache: 'gradle'
39-
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
40+
distribution: "temurin"
41+
java-version: "17"
42+
cache: "gradle"
43+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
4044
with:
41-
channel: 'stable'
45+
flutter-version: "3.19.x"
46+
channel: "stable"
4247
cache: true
4348
- uses: bluefireteam/melos-action@720a109b686f61979b4f9f0d14f582ab1637647e
4449
with:
45-
melos-version: '3.0.1'
46-
- name: 'Run flutter test'
50+
melos-version: "3.0.1"
51+
- name: "Run flutter test"
4752
run: melos run test:dart
4853

4954
test-android:
5055
timeout-minutes: 45
51-
runs-on:
52-
labels: ubuntu-latest-8core
56+
runs-on:
57+
labels: ubuntu-latest
5358
steps:
54-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
59+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
5560
- name: Override nav sdk dependencies
5661
uses: ./.github/actions/dependency-override
5762
with:
5863
NAV_SDK_DEPLOY_KEY: ${{ secrets.NAV_SDK_GIT_REPO_DEPLOY_KEY }}
5964
NAV_SDK_DEPENDENCY_OVERRIDE: ${{ secrets.NAV_SDK_OVERRIDE }}
6065
- uses: actions/setup-java@v4
6166
with:
62-
distribution: 'temurin'
63-
java-version: '17'
64-
cache: 'gradle'
65-
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
67+
distribution: "temurin"
68+
java-version: "17"
69+
cache: "gradle"
70+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
6671
with:
67-
flutter-version: '3.16.x'
68-
channel: 'stable'
72+
flutter-version: "3.19.x"
73+
channel: "stable"
6974
cache: true
7075
- uses: bluefireteam/melos-action@720a109b686f61979b4f9f0d14f582ab1637647e
7176
with:
72-
melos-version: '3.0.1'
73-
- name: 'Run Android native unit tests'
77+
melos-version: "3.0.1"
78+
- name: "Run Android native unit tests"
7479
run: melos run test:android
7580

7681
test-ios:
7782
timeout-minutes: 45
78-
runs-on:
83+
runs-on:
7984
labels: macos-latest-xlarge
8085
strategy:
8186
matrix:
82-
working_directory:
83-
['example']
87+
working_directory: ["example"]
8488
steps:
85-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
89+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
8690
- name: Override nav sdk dependencies
8791
uses: ./.github/actions/dependency-override
8892
with:
8993
NAV_SDK_DEPLOY_KEY: ${{ secrets.NAV_SDK_GIT_REPO_DEPLOY_KEY }}
9094
NAV_SDK_DEPENDENCY_OVERRIDE: ${{ secrets.NAV_SDK_OVERRIDE }}
9195
- uses: actions/cache@v4
9296
with:
93-
path: '**/Pods'
97+
path: "**/Pods"
9498
key: ${{ runner.os }}-pods-${{ hashFiles('**/*.podspec') }}
9599
restore-keys: |
96100
${{ runner.os }}-pods-
97-
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
101+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
98102
with:
99-
flutter-version: '3.16.x'
100-
channel: 'stable'
103+
flutter-version: "3.19.x"
104+
channel: "stable"
101105
cache: true
102106
- uses: bluefireteam/melos-action@720a109b686f61979b4f9f0d14f582ab1637647e
103107
with:
104-
melos-version: '3.0.1'
108+
melos-version: "3.0.1"
105109
- name: Generate necessary files with flutter build
106110
working-directory: ${{ matrix.working_directory }}
107-
run: flutter build ios --config-only
108-
- name: 'Run iOS native unit tests'
111+
run: flutter build ios --config-only
112+
- name: "Run iOS native unit tests"
109113
run: DEVICE='iPhone 14 Pro' melos run test:ios
110114

111115
build-android:
112-
needs: [test-dart,test-android,test-ios]
116+
needs: [test-dart, test-android, test-ios]
113117
if: contains(github.base_ref, 'main')
114118
timeout-minutes: 45
115-
runs-on:
116-
labels: ubuntu-latest-8core
119+
runs-on:
120+
labels: ubuntu-latest
117121
env:
118122
MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }}
119123
steps:
120-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
124+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
121125
- name: Override nav sdk dependencies
122126
uses: ./.github/actions/dependency-override
123127
with:
124128
NAV_SDK_DEPLOY_KEY: ${{ secrets.NAV_SDK_GIT_REPO_DEPLOY_KEY }}
125129
NAV_SDK_DEPENDENCY_OVERRIDE: ${{ secrets.NAV_SDK_OVERRIDE }}
126130
- uses: actions/setup-java@v4
127131
with:
128-
distribution: 'temurin'
129-
java-version: '17'
130-
cache: 'gradle'
131-
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
132+
distribution: "temurin"
133+
java-version: "17"
134+
cache: "gradle"
135+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
132136
with:
133-
channel: 'stable'
137+
flutter-version: "3.19.x"
138+
channel: "stable"
134139
cache: true
135140
- uses: bluefireteam/melos-action@720a109b686f61979b4f9f0d14f582ab1637647e
136141
with:
137-
melos-version: '3.0.1'
138-
- name: 'Run build for Android'
142+
melos-version: "3.0.1"
143+
- name: "Run build for Android"
139144
run: melos run flutter-build-android
140145

141146
build-ios:
142-
needs: [test-dart,test-android,test-ios]
147+
needs: [test-dart, test-android, test-ios]
143148
if: contains(github.base_ref, 'main')
144149
timeout-minutes: 90
145150
runs-on: macos-latest-xlarge
146151
env:
147152
MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }}
148153
steps:
149-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
154+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
150155
- name: Override nav sdk dependencies
151156
uses: ./.github/actions/dependency-override
152157
with:
153158
NAV_SDK_DEPLOY_KEY: ${{ secrets.NAV_SDK_GIT_REPO_DEPLOY_KEY }}
154159
NAV_SDK_DEPENDENCY_OVERRIDE: ${{ secrets.NAV_SDK_OVERRIDE }}
155-
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
160+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
156161
with:
157-
channel: 'stable'
162+
flutter-version: "3.19.x"
163+
channel: "stable"
158164
cache: true
159165
architecture: x64
160166
- uses: bluefireteam/melos-action@720a109b686f61979b4f9f0d14f582ab1637647e
161167
with:
162-
melos-version: '3.0.1'
168+
melos-version: "3.0.1"
163169
- uses: actions/cache@v4
164170
with:
165-
path: '**/Pods'
171+
path: "**/Pods"
166172
key: ${{ runner.os }}-pods-${{ hashFiles('**/*.podspec') }}
167173
restore-keys: |
168174
${{ runner.os }}-pods-
169-
- name: 'Run build for iOS'
175+
- name: "Run build for iOS"
170176
run: melos run flutter-build-ios

.github/workflows/licence-check.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,39 @@ on:
1919
branches:
2020
- main
2121

22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
2226
jobs:
2327
check-files-license-headers:
2428
runs-on: ubuntu-latest
2529
timeout-minutes: 30
2630
steps:
27-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
31+
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
2832
- name: Override nav sdk dependencies
2933
uses: ./.github/actions/dependency-override
3034
with:
3135
NAV_SDK_DEPLOY_KEY: ${{ secrets.NAV_SDK_GIT_REPO_DEPLOY_KEY }}
3236
NAV_SDK_DEPENDENCY_OVERRIDE: ${{ secrets.NAV_SDK_OVERRIDE }}
3337
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
3438
with:
35-
go-version: '^1.13.1'
39+
go-version: "^1.13.1"
3640
# Go is used by addlicense command (addlicense is used in melos run
3741
# check-license-header)
3842
- run: go install github.com/google/addlicense@latest
3943
- name: Install Flutter
40-
uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
44+
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
4145
with:
42-
channel: 'stable'
46+
flutter-version: "3.19.x"
47+
channel: "stable"
4348
cache: true
4449
- name: Install Melos
4550
uses: bluefireteam/melos-action@720a109b686f61979b4f9f0d14f582ab1637647e
4651
with:
4752
# Running `melos bootstrap` is not needed because we use Melos just
4853
# for the `check-license-header` script.
4954
run-bootstrap: false
50-
melos-version: '3.0.1'
55+
melos-version: "3.0.1"
5156
- name: Check license header
5257
run: melos run check-license-header

.github/workflows/release-please.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ jobs:
3333
release-type: dart
3434
package-name: "@googlemaps/flutter-driver-sdk"
3535
bump-minor-pre-major: true
36+
bump-patch-for-minor-pre-major: true
37+
prerelease: true
38+
prerelease-type: beta

0 commit comments

Comments
 (0)