Skip to content

Commit

Permalink
Merge pull request #722 from techouse/chore/drive-ios
Browse files Browse the repository at this point in the history
chore: fix/update example & integration CI
  • Loading branch information
juliansteenbakker authored Aug 13, 2024
2 parents cb30953 + 9a12e96 commit 2f49b61
Show file tree
Hide file tree
Showing 50 changed files with 778 additions and 864 deletions.
40 changes: 13 additions & 27 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
name: code analysis & formatting

on: [push, pull_request]
on:
- push
- pull_request
defaults:
run:
shell: bash
env:
PUB_ENVIRONMENT: bot.github

jobs:
analysis:
analysis_and_formatting:
name: Analysis & Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
# Use the community Action to install Flutter
- uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Version
run: flutter doctor -v
- name: Install melos
Expand All @@ -24,24 +29,5 @@ jobs:
run: melos bootstrap
- name: Linter
run: melos analyze
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
# Use the community Action to install Flutter
- uses: subosito/flutter-action@v2
- name: Version
run: flutter doctor -v
- 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: Format
run: melos format --output none --set-exit-if-changed
run: melos format --output none --set-exit-if-changed
107 changes: 74 additions & 33 deletions .github/workflows/flutter_drive.yml
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
16 changes: 8 additions & 8 deletions flutter_secure_storage/example/.metadata
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487
channel: beta
revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487
base_revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487
- platform: ios
create_revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487
base_revision: 8c1149878bbb8f062aecfab4d825e5b87bdb4487
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- platform: macos
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3

# User provided section

Expand Down
16 changes: 9 additions & 7 deletions flutter_secure_storage/example/android/.gitignore
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
56 changes: 0 additions & 56 deletions flutter_secure_storage/example/android/app/build.gradle

This file was deleted.

64 changes: 64 additions & 0 deletions flutter_secure_storage/example/android/app/build.gradle.kts
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 = "../.."
}

This file was deleted.

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()
29 changes: 0 additions & 29 deletions flutter_secure_storage/example/android/build.gradle

This file was deleted.

Loading

0 comments on commit 2f49b61

Please sign in to comment.