Skip to content

Commit 6944287

Browse files
authored
chore(actions): bump min swift version to 5.9 and updated CI jobs (#4916)
1 parent 4dc0df5 commit 6944287

File tree

44 files changed

+2100
-2006
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2100
-2006
lines changed

.github/composite_actions/launch_android_emulator/dist/main.cjs

Lines changed: 492 additions & 487 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/launch_android_emulator/dist/main.cjs.map

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/launch_ios_simulator/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Launches an iOS simulator and caches it for further action runs
33
inputs:
44
ios-version:
55
description: The iOS version
6-
default: "16"
6+
default: "latest"
77
runs:
88
using: "node16"
99
main: "dist/index.mjs"

.github/composite_actions/launch_ios_simulator/dist/main.cjs

Lines changed: 458 additions & 408 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/launch_ios_simulator/dist/main.cjs.map

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/log_cw_metric/dist/main.cjs

Lines changed: 479 additions & 471 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/log_cw_metric/dist/main.cjs.map

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/setup_chromedriver/dist/main.cjs

Lines changed: 492 additions & 495 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/composite_actions/setup_chromedriver/dist/main.cjs.map

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/actions.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ jobs:
7373
fail-fast: false
7474
matrix:
7575
os:
76-
- macos-latest
76+
# TODO(equartey): Change to `macos-latest` after github migrates their runners - https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
77+
- macos-14
7778
- ubuntu-latest
7879
runs-on: ${{ matrix.os }}
7980
steps:
@@ -88,16 +89,17 @@ jobs:
8889
# It is recommended that all actions requiring a simulator be run on XL runners
8990
# since the process of installing new runtimes and building with Xcode can be
9091
# incredibly slow otherwise.
91-
runs-on: macos-latest-xl
92+
# TODO(equartey): Change to `macos-latest` after github migrates their runners - https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
93+
runs-on: macos-14-xlarge
9294
# Timeout as a stop-gap for further investigating. This action should never need more
9395
# than 20 minutes to do its work.
9496
timeout-minutes: 20
9597
strategy:
9698
fail-fast: false
9799
matrix:
98100
ios-version:
99-
- "14.5"
100-
- "16"
101+
- "15.0"
102+
- "latest"
101103
steps:
102104
- name: Git Checkout
103105
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.6.0

.github/workflows/amplify_canaries.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ concurrency:
1616
jobs:
1717
# Ensure an app pulling in published Amplify libraries can build properly
1818
build:
19-
runs-on: macos-latest
19+
# TODO(equartey): Change to `macos-latest` after github migrates their runners - https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
20+
runs-on: macos-14
2021
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
2122
permissions:
2223
id-token: write
@@ -145,7 +146,8 @@ jobs:
145146
platform-version: ${{ matrix.ios-version }}
146147

147148
e2e-ios:
148-
runs-on: macos-latest-xl
149+
# TODO(equartey): Change to `macos-latest` after github migrates their runners - https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-availabl
150+
runs-on: macos-14-xlarge
149151
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
150152
permissions:
151153
id-token: write
@@ -162,8 +164,8 @@ jobs:
162164
- channel: "stable"
163165
flutter-version: "3.19.0"
164166
ios-version:
165-
- "14.5"
166-
- "16"
167+
- "15.0"
168+
- "latest"
167169
steps:
168170
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.6.0
169171
with:

.github/workflows/dart_native.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os:
23-
- macos-latest
23+
# TODO(equartey): Change to `macos-latest` after github migrates their runners - https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
24+
- macos-14
2425
- windows-latest
2526
runs-on: ${{ matrix.os }}
2627
steps:

.github/workflows/e2e_ios.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ on:
1717

1818
jobs:
1919
e2e-test-ios:
20-
runs-on: macos-latest-xl
20+
# TODO(equartey): Change to `macos-latest` after github migrates their runners - https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
21+
runs-on: macos-14-xlarge
2122
strategy:
2223
# Allows other matrix items to run if one fails
2324
fail-fast: false

.github/workflows/flutter_ios.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ on:
1818

1919
jobs:
2020
flutter-ios-build-and-test:
21-
runs-on: macos-latest-xl
21+
# TODO(equartey): Change to `macos-latest` after github migrates their runners - https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
22+
runs-on: macos-14-xlarge
2223
timeout-minutes: 30
2324
strategy:
2425
# Allows other matrix items to run if one fails

.github/workflows/flutter_vm.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ on:
1717

1818
jobs:
1919
test-flutter-vm:
20-
runs-on: ${{ inputs.has-goldens && 'macos-latest' || 'ubuntu-latest' }}
20+
# TODO(equartey): Change to `macos-latest` after github migrates their runners - https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/
21+
runs-on: ${{ inputs.has-goldens && 'macos-14' || 'ubuntu-latest' }}
2122
timeout-minutes: 60
2223
strategy:
2324
# Allows other matrix items to run if one fails

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"dart.onlyAnalyzeProjectsWithOpenFiles": true,
1717
"files.insertFinalNewline": true,
1818
"editor.codeActionsOnSave": {
19-
"source.fixAll": true,
20-
"source.organizeImports": true
19+
"source.fixAll": "explicit",
20+
"source.organizeImports": "explicit"
2121
},
2222
"[typescript]": {
2323
"editor.defaultFormatter": "esbenp.prettier-vscode"

actions/bin/launch_ios_simulator.dart

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import 'package:collection/collection.dart';
99
Future<void> main(List<String> args) => wrapMain(launch);
1010

1111
Future<void> launch() async {
12-
final iosVersion = core.getInput('ios-version');
13-
core.info('Launching simulator for iOS $iosVersion');
12+
final iosVersionArg = core.getInput('ios-version');
13+
final iosVersion =
14+
iosVersionArg == 'latest' ? await getLatest() : 'iOS $iosVersionArg';
15+
core.info('Launching simulator for $iosVersion');
1416

1517
var runtimeIdentifier = await core.withGroup(
1618
'Check for existing runtime',
@@ -21,7 +23,7 @@ Future<void> launch() async {
2123
},
2224
);
2325
if (runtimeIdentifier == null) {
24-
core.info('No runtime found for iOS $iosVersion');
26+
core.info('No runtime found for $iosVersion');
2527
await installXcodes();
2628
await installRuntime(iosVersion);
2729
}
@@ -79,7 +81,7 @@ Future<String?> getRuntimeId(String iosVersion) async {
7981
final runtimes =
8082
(runtimesJson['runtimes'] as List<Object?>).cast<Map<String, Object?>>();
8183
final versionRuntime = runtimes.firstWhereOrNull(
82-
(runtime) => (runtime['name'] as String).startsWith('iOS $iosVersion'),
84+
(runtime) => (runtime['name'] as String).startsWith(iosVersion),
8385
);
8486
if (versionRuntime == null) {
8587
return null;
@@ -99,6 +101,16 @@ Future<void> installXcodes() => core.withGroup('Install xcodes', () async {
99101
}
100102
});
101103

104+
Future<String> getLatest() async {
105+
final version = await exec
106+
.exec('/bin/sh', ['-c', r'xcodes runtimes | grep -e "iOS" | tail -n 1']);
107+
if (version.exitCode != 0) {
108+
throw Exception('Could not get latest version');
109+
}
110+
111+
return version.stdout.replaceAll(' (Installed)', '').trim();
112+
}
113+
102114
/// Installs the iOS runtime for the given [iosVersion].
103115
Future<void> installRuntime(String iosVersion) async {
104116
await core.withGroup('Install runtime', () async {
@@ -108,7 +120,7 @@ Future<void> installRuntime(String iosVersion) async {
108120
'xcodes',
109121
'runtimes',
110122
'install',
111-
'iOS $iosVersion',
123+
iosVersion,
112124
'--no-color',
113125
],
114126
);

actions/bin/launch_ios_simulator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Launches an iOS simulator and caches it for further action runs
33
inputs:
44
ios-version:
55
description: The iOS version
6-
default: "16"
6+
default: "latest"
77
runs:
88
using: "node16"
99
main: "dist/index.mjs"

build-support/build_canary.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cd $PROJECT_DIR
1010
# generate
1111
flutter create --project-name=amplified_todo .
1212
flutter pub add amplify_flutter \
13-
amplify_datastore:^1.0.0-supports-only-mobile.0 \
13+
amplify_datastore \
1414
amplify_storage_s3 \
1515
amplify_analytics_pinpoint \
1616
amplify_auth_cognito \
@@ -24,12 +24,25 @@ cp -r $ROOT_DIR/canaries/lib .
2424
cp $ROOT_DIR/build-support/dummy_amplifyconfiguration.dart lib/amplifyconfiguration.dart
2525

2626
# Android
27-
sed -i '' -e "s/ext.kotlin_version = .*/ext.kotlin_version = \"1.9.10\"/" ./android/build.gradle
27+
sed -i '' -e "s/id \"com.android.application\" .*/id \"com.android.application\" version \"8.1.0\" apply false/" ./android/settings.gradle
28+
sed -i '' -e "s/id \"org.jetbrains.kotlin.android\" .*/id \"org.jetbrains.kotlin.android\" version \"1.9.10\" apply false/" ./android/settings.gradle
29+
cat ./android/settings.gradle
30+
2831
# TODO(khatruong2009): remove this line after the next stable release (3.22.0 or 4.0)
2932
sed -i '' -e "s/minSdkVersion .*/minSdkVersion 24/" ./android/app/build.gradle
3033
sed -i '' -e "s/minSdk .*/minSdk 24/" ./android/app/build.gradle
31-
sed -i '' -e "s/compileSdk .*/compileSdk 33/" ./android/app/build.gradle
34+
sed -i '' -e '/id "kotlin-android"/a\
35+
id '\''kotlin-parcelize'\''' ./android/app/build.gradle
36+
sed -i '' -e "s/compileSdk .*/compileSdk = 34/" ./android/app/build.gradle
37+
sed -i '' -e "s/sourceCompatibility .*/sourceCompatibility = JavaVersion.VERSION_17/" ./android/app/build.gradle
38+
sed -i '' -e "s/targetCompatibility .*/targetCompatibility = JavaVersion.VERSION_17/" ./android/app/build.gradle
39+
# TODO(equartey): remove this line after the next stable release (3.22.0 or 4.0)
40+
sed -i '' -e '/kotlinOptions {/,/}/ s/jvmTarget = .*/jvmTarget = '\''17'\''/' ./android/app/build.gradle
3241
cat ./android/app/build.gradle
42+
43+
sed -i '' -e "s#distributionUrl=.*#distributionUrl=https\\://services.gradle.org/distributions/gradle-8.1-all.zip#" ./android/gradle/wrapper/gradle-wrapper.properties
44+
cat ./android/gradle/wrapper/gradle-wrapper.properties
45+
3346
# iOS
3447
sed -i '' -e "s/# platform .*/platform :ios, '13.0'/" ./ios/Podfile
3548
cat ./ios/Podfile

canaries/android/app/build.gradle

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,49 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
6+
}
7+
18
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
9+
def localPropertiesFile = rootProject.file("local.properties")
310
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
11+
localPropertiesFile.withReader("UTF-8") { reader ->
512
localProperties.load(reader)
613
}
714
}
815

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16+
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
1517
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
18+
flutterVersionCode = "1"
1719
}
1820

19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21+
def flutterVersionName = localProperties.getProperty("flutter.versionName")
2022
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
23+
flutterVersionName = "1.0"
2224
}
2325

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2826
android {
29-
namespace 'com.amazonaws.amplify.amplified_todo'
30-
compileSdk flutter.compileSdkVersion
31-
ndkVersion flutter.ndkVersion
27+
namespace = 'com.amazonaws.amplify.amplified_todo'
28+
compileSdk = 34
29+
ndkVersion = flutter.ndkVersion
3230

3331
compileOptions {
34-
sourceCompatibility JavaVersion.VERSION_17
35-
targetCompatibility JavaVersion.VERSION_17
32+
sourceCompatibility = JavaVersion.VERSION_17
33+
targetCompatibility = JavaVersion.VERSION_17
3634
}
3735

3836
kotlinOptions {
3937
jvmTarget = '17'
4038
}
4139

42-
sourceSets {
43-
main.java.srcDirs += 'src/main/kotlin'
44-
}
45-
4640
defaultConfig {
4741
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
48-
applicationId "com.amazonaws.amplify.amplified_todo"
42+
applicationId = "com.amazonaws.amplify.amplified_todo"
4943
// You can update the following values to match your application needs.
5044
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
51-
minSdkVersion 24
52-
targetSdkVersion flutter.targetSdkVersion
45+
minSdk 24
46+
targetSdk flutter.targetSdkVersion
5347
versionCode flutterVersionCode.toInteger()
5448
versionName flutterVersionName
5549
}
@@ -58,15 +52,11 @@ android {
5852
release {
5953
// TODO: Add your own signing config for the release build.
6054
// Signing with the debug keys for now, so `flutter run --release` works.
61-
signingConfig signingConfigs.debug
55+
signingConfig = signingConfigs.debug
6256
}
6357
}
6458
}
6559

6660
flutter {
67-
source '../..'
68-
}
69-
70-
dependencies {
71-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
61+
source = "../.."
7262
}

canaries/android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.amazonaws.amplify.amplified_todo">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<!-- The INTERNET permission is required for development. Specifically,
43
the Flutter tool needs it to communicate with the running application
54
to allow setting breakpoints, to provide hot reload, etc.

canaries/android/app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.amazonaws.amplify.amplified_todo">
3-
<application
4-
android:label="amplified_todo"
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<application
3+
android:label="canaries"
54
android:name="${applicationName}"
65
android:icon="@mipmap/ic_launcher">
76
<activity
87
android:name=".MainActivity"
98
android:exported="true"
109
android:launchMode="singleTop"
10+
android:taskAffinity=""
1111
android:theme="@style/LaunchTheme"
1212
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1313
android:hardwareAccelerated="true"
@@ -31,4 +31,15 @@
3131
android:name="flutterEmbedding"
3232
android:value="2" />
3333
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
3445
</manifest>

canaries/android/app/src/profile/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.amazonaws.amplify.amplified_todo">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<!-- The INTERNET permission is required for development. Specifically,
43
the Flutter tool needs it to communicate with the running application
54
to allow setting breakpoints, to provide hot reload, etc.

0 commit comments

Comments
 (0)