-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #722 from techouse/chore/drive-ios
chore: fix/update example & integration CI
- Loading branch information
Showing
50 changed files
with
778 additions
and
864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,81 @@ | ||
name: integration test | ||
on: [pull_request] | ||
|
||
on: | ||
- pull_request | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
PUB_ENVIRONMENT: bot.github | ||
|
||
jobs: | ||
drive_android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: subosito/flutter-action@v2 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Enable KVM | ||
run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
- name: Install melos | ||
run: | | ||
flutter pub global activate melos | ||
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH | ||
echo "$HOME/AppData/Local/Pub/Cache/bin" >> $GITHUB_PATH | ||
- name: Initialize workspace through melos | ||
run: melos bootstrap | ||
- name: "Run Flutter Driver tests API 21" | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: 21 | ||
name: Android | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
include: | ||
- api-level: 21 | ||
target: default | ||
arch: x86 | ||
script: "cd example && flutter drive --target=test_driver/app.dart" | ||
working-directory: ./flutter_secure_storage | ||
- name: "Run Flutter Driver tests API 34" | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: 34 | ||
- api-level: 34 | ||
target: google_apis | ||
arch: x86_64 | ||
script: "cd example && flutter drive --target=test_driver/app.dart" | ||
working-directory: ./flutter_secure_storage | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
flutter-version: 3.22.x | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: "temurin" | ||
java-version: "17" | ||
cache: "gradle" | ||
- name: Enable KVM | ||
run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
- name: Install melos | ||
run: | | ||
flutter pub global activate melos | ||
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH | ||
echo "$HOME/AppData/Local/Pub/Cache/bin" >> $GITHUB_PATH | ||
- name: Initialize workspace through melos | ||
run: melos bootstrap | ||
- name: Run Flutter Integration tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: ${{ matrix.target }} | ||
arch: ${{ matrix.arch }} | ||
script: flutter test integration_test | ||
working-directory: flutter_secure_storage/example | ||
drive_ios: | ||
name: iOS | ||
runs-on: macos-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: stable | ||
flutter-version: 3.22.x | ||
- name: Install melos | ||
run: | | ||
flutter pub global activate melos | ||
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH | ||
echo "$HOME/AppData/Local/Pub/Cache/bin" >> $GITHUB_PATH | ||
- name: Initialize workspace through melos | ||
run: melos bootstrap | ||
- uses: futureware-tech/simulator-action@v3 | ||
with: | ||
os: iOS | ||
os_version: 17.5 | ||
model: "iPhone 15" | ||
- name: Run Flutter Integration tests | ||
working-directory: flutter_secure_storage/example | ||
run: flutter test integration_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
*.iml | ||
.gradle | ||
gradle-wrapper.jar | ||
/.gradle | ||
/captures/ | ||
/gradlew | ||
/gradlew.bat | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
GeneratedPluginRegistrant.java | ||
|
||
# Remember to never publicly share your keystore. | ||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app | ||
key.properties |
This file was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
flutter_secure_storage/example/android/app/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import java.util.Properties | ||
import java.nio.file.Files | ||
import java.nio.file.Path | ||
|
||
plugins { | ||
id("com.android.application") | ||
id("org.jetbrains.kotlin.android") | ||
id("dev.flutter.flutter-gradle-plugin") | ||
} | ||
|
||
val localProperties: Properties = Properties() | ||
val localPropertiesFile: Path = rootProject.file("local.properties").toPath() | ||
if (Files.exists(localPropertiesFile)) { | ||
Files.newBufferedReader(localPropertiesFile).use { reader -> | ||
localProperties.load(reader) | ||
} | ||
} | ||
|
||
val flutterRoot: String = localProperties.getProperty("flutter.sdk") | ||
?: throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | ||
|
||
val flutterVersionCode: String = localProperties.getProperty("flutter.versionCode") ?: "1" | ||
val flutterVersionName: String = localProperties.getProperty("flutter.versionName") ?: "1.0" | ||
|
||
android { | ||
namespace = "com.it_nomads.fluttersecurestorageexample" | ||
|
||
compileSdk = 34 | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_17.toString() | ||
} | ||
|
||
sourceSets { | ||
named("main") { | ||
java.srcDir("src/main/kotlin") | ||
} | ||
} | ||
|
||
defaultConfig { | ||
applicationId = "com.it_nomads.fluttersecurestorageexample" | ||
minSdk = flutter.minSdkVersion | ||
targetSdk = 34 | ||
versionCode = flutterVersionCode.toInt() | ||
versionName = flutterVersionName | ||
} | ||
|
||
buildTypes { | ||
getByName("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.getByName("debug") | ||
} | ||
} | ||
} | ||
|
||
flutter { | ||
source = "../.." | ||
} |
7 changes: 0 additions & 7 deletions
7
...ple/android/app/src/main/java/com/it_nomads/fluttersecurestorageexample/MainActivity.java
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...ple/android/app/src/main/kotlin/com/it_nomads/fluttersecurestorageexample/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.it_nomads.fluttersecurestorageexample; | ||
|
||
import io.flutter.embedding.android.FlutterActivity | ||
|
||
class MainActivity: FlutterActivity() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.