Skip to content

Commit

Permalink
chore(actions): bump min swift version to 5.9 and updated CI jobs (#4916
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Equartey committed May 28, 2024
1 parent 4dc0df5 commit 6944287
Show file tree
Hide file tree
Showing 44 changed files with 2,100 additions and 2,006 deletions.
979 changes: 492 additions & 487 deletions .github/composite_actions/launch_android_emulator/dist/main.cjs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/composite_actions/launch_ios_simulator/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Launches an iOS simulator and caches it for further action runs
inputs:
ios-version:
description: The iOS version
default: "16"
default: "latest"
runs:
using: "node16"
main: "dist/index.mjs"
866 changes: 458 additions & 408 deletions .github/composite_actions/launch_ios_simulator/dist/main.cjs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions .github/composite_actions/launch_ios_simulator/dist/main.cjs.map

Large diffs are not rendered by default.

950 changes: 479 additions & 471 deletions .github/composite_actions/log_cw_metric/dist/main.cjs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions .github/composite_actions/log_cw_metric/dist/main.cjs.map

Large diffs are not rendered by default.

987 changes: 492 additions & 495 deletions .github/composite_actions/setup_chromedriver/dist/main.cjs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions .github/composite_actions/setup_chromedriver/dist/main.cjs.map

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ jobs:
fail-fast: false
matrix:
os:
- macos-latest
# 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/
- macos-14
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -88,16 +89,17 @@ jobs:
# It is recommended that all actions requiring a simulator be run on XL runners
# since the process of installing new runtimes and building with Xcode can be
# incredibly slow otherwise.
runs-on: macos-latest-xl
# 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/
runs-on: macos-14-xlarge
# Timeout as a stop-gap for further investigating. This action should never need more
# than 20 minutes to do its work.
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
ios-version:
- "14.5"
- "16"
- "15.0"
- "latest"
steps:
- name: Git Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.6.0
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/amplify_canaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ concurrency:
jobs:
# Ensure an app pulling in published Amplify libraries can build properly
build:
runs-on: macos-latest
# 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
runs-on: macos-14
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
Expand Down Expand Up @@ -145,7 +146,8 @@ jobs:
platform-version: ${{ matrix.ios-version }}

e2e-ios:
runs-on: macos-latest-xl
# 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
runs-on: macos-14-xlarge
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
Expand All @@ -162,8 +164,8 @@ jobs:
- channel: "stable"
flutter-version: "3.19.0"
ios-version:
- "14.5"
- "16"
- "15.0"
- "latest"
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # 3.6.0
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dart_native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
fail-fast: false
matrix:
os:
- macos-latest
# 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/
- macos-14
- windows-latest
runs-on: ${{ matrix.os }}
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/e2e_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ on:

jobs:
e2e-test-ios:
runs-on: macos-latest-xl
# 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/
runs-on: macos-14-xlarge
strategy:
# Allows other matrix items to run if one fails
fail-fast: false
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/flutter_ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ on:

jobs:
flutter-ios-build-and-test:
runs-on: macos-latest-xl
# 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/
runs-on: macos-14-xlarge
timeout-minutes: 30
strategy:
# Allows other matrix items to run if one fails
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/flutter_vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ on:

jobs:
test-flutter-vm:
runs-on: ${{ inputs.has-goldens && 'macos-latest' || 'ubuntu-latest' }}
# 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/
runs-on: ${{ inputs.has-goldens && 'macos-14' || 'ubuntu-latest' }}
timeout-minutes: 60
strategy:
# Allows other matrix items to run if one fails
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"dart.onlyAnalyzeProjectsWithOpenFiles": true,
"files.insertFinalNewline": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
22 changes: 17 additions & 5 deletions actions/bin/launch_ios_simulator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import 'package:collection/collection.dart';
Future<void> main(List<String> args) => wrapMain(launch);

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

var runtimeIdentifier = await core.withGroup(
'Check for existing runtime',
Expand All @@ -21,7 +23,7 @@ Future<void> launch() async {
},
);
if (runtimeIdentifier == null) {
core.info('No runtime found for iOS $iosVersion');
core.info('No runtime found for $iosVersion');
await installXcodes();
await installRuntime(iosVersion);
}
Expand Down Expand Up @@ -79,7 +81,7 @@ Future<String?> getRuntimeId(String iosVersion) async {
final runtimes =
(runtimesJson['runtimes'] as List<Object?>).cast<Map<String, Object?>>();
final versionRuntime = runtimes.firstWhereOrNull(
(runtime) => (runtime['name'] as String).startsWith('iOS $iosVersion'),
(runtime) => (runtime['name'] as String).startsWith(iosVersion),
);
if (versionRuntime == null) {
return null;
Expand All @@ -99,6 +101,16 @@ Future<void> installXcodes() => core.withGroup('Install xcodes', () async {
}
});

Future<String> getLatest() async {
final version = await exec
.exec('/bin/sh', ['-c', r'xcodes runtimes | grep -e "iOS" | tail -n 1']);
if (version.exitCode != 0) {
throw Exception('Could not get latest version');
}

return version.stdout.replaceAll(' (Installed)', '').trim();
}

/// Installs the iOS runtime for the given [iosVersion].
Future<void> installRuntime(String iosVersion) async {
await core.withGroup('Install runtime', () async {
Expand All @@ -108,7 +120,7 @@ Future<void> installRuntime(String iosVersion) async {
'xcodes',
'runtimes',
'install',
'iOS $iosVersion',
iosVersion,
'--no-color',
],
);
Expand Down
2 changes: 1 addition & 1 deletion actions/bin/launch_ios_simulator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Launches an iOS simulator and caches it for further action runs
inputs:
ios-version:
description: The iOS version
default: "16"
default: "latest"
runs:
using: "node16"
main: "dist/index.mjs"
19 changes: 16 additions & 3 deletions build-support/build_canary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd $PROJECT_DIR
# generate
flutter create --project-name=amplified_todo .
flutter pub add amplify_flutter \
amplify_datastore:^1.0.0-supports-only-mobile.0 \
amplify_datastore \
amplify_storage_s3 \
amplify_analytics_pinpoint \
amplify_auth_cognito \
Expand All @@ -24,12 +24,25 @@ cp -r $ROOT_DIR/canaries/lib .
cp $ROOT_DIR/build-support/dummy_amplifyconfiguration.dart lib/amplifyconfiguration.dart

# Android
sed -i '' -e "s/ext.kotlin_version = .*/ext.kotlin_version = \"1.9.10\"/" ./android/build.gradle
sed -i '' -e "s/id \"com.android.application\" .*/id \"com.android.application\" version \"8.1.0\" apply false/" ./android/settings.gradle
sed -i '' -e "s/id \"org.jetbrains.kotlin.android\" .*/id \"org.jetbrains.kotlin.android\" version \"1.9.10\" apply false/" ./android/settings.gradle
cat ./android/settings.gradle

# TODO(khatruong2009): remove this line after the next stable release (3.22.0 or 4.0)
sed -i '' -e "s/minSdkVersion .*/minSdkVersion 24/" ./android/app/build.gradle
sed -i '' -e "s/minSdk .*/minSdk 24/" ./android/app/build.gradle
sed -i '' -e "s/compileSdk .*/compileSdk 33/" ./android/app/build.gradle
sed -i '' -e '/id "kotlin-android"/a\
id '\''kotlin-parcelize'\''' ./android/app/build.gradle
sed -i '' -e "s/compileSdk .*/compileSdk = 34/" ./android/app/build.gradle
sed -i '' -e "s/sourceCompatibility .*/sourceCompatibility = JavaVersion.VERSION_17/" ./android/app/build.gradle
sed -i '' -e "s/targetCompatibility .*/targetCompatibility = JavaVersion.VERSION_17/" ./android/app/build.gradle
# TODO(equartey): remove this line after the next stable release (3.22.0 or 4.0)
sed -i '' -e '/kotlinOptions {/,/}/ s/jvmTarget = .*/jvmTarget = '\''17'\''/' ./android/app/build.gradle
cat ./android/app/build.gradle

sed -i '' -e "s#distributionUrl=.*#distributionUrl=https\\://services.gradle.org/distributions/gradle-8.1-all.zip#" ./android/gradle/wrapper/gradle-wrapper.properties
cat ./android/gradle/wrapper/gradle-wrapper.properties

# iOS
sed -i '' -e "s/# platform .*/platform :ios, '13.0'/" ./ios/Podfile
cat ./ios/Podfile
Expand Down
56 changes: 23 additions & 33 deletions canaries/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,55 +1,49 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = '1'
flutterVersionCode = "1"
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = '1.0'
flutterVersionName = "1.0"
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace 'com.amazonaws.amplify.amplified_todo'
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
namespace = 'com.amazonaws.amplify.amplified_todo'
compileSdk = 34
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.amazonaws.amplify.amplified_todo"
applicationId = "com.amazonaws.amplify.amplified_todo"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 24
targetSdkVersion flutter.targetSdkVersion
minSdk 24
targetSdk flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -58,15 +52,11 @@ android {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig = signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
source = "../.."
}
3 changes: 1 addition & 2 deletions canaries/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazonaws.amplify.amplified_todo">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
19 changes: 15 additions & 4 deletions canaries/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazonaws.amplify.amplified_todo">
<application
android:label="amplified_todo"
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="canaries"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand All @@ -31,4 +31,15 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>
3 changes: 1 addition & 2 deletions canaries/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazonaws.amplify.amplified_todo">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
Loading

0 comments on commit 6944287

Please sign in to comment.