Skip to content

Commit

Permalink
Merge pull request #4 from eaceto/feature/add-github-actions
Browse files Browse the repository at this point in the history
Add GitHub actions for automatic publishing changes to pub.dev
  • Loading branch information
eaceto authored Oct 19, 2023
2 parents 7b61f8e + 15b04e5 commit 4f6ffd6
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 19 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: ci
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- 'main'
paths-ignore:
- '**.md'
- 'docs/**'

permissions: write-all

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
ci:
name: Run tests
if: |
github.repository_owner == 'eaceto' &&
github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
# Checks out a copy of the repo.
- name: Check out code
uses: actions/checkout@v4
# Install Flutter stable version
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
# Get dependencies
- run: flutter pub get
# Run tests
- run: flutter test
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.0

- Add GitHub actions for publishing releases to pub.dev automatically

## 1.1.0

- Add a localization model for messages shown to the user
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'dev.eaceto.mobile.oss.flutter.flutter_local_authentication'
version '1.1.0'
version '1.2.0'

buildscript {
ext.kotlin_version = '1.7.10'
Expand Down
2 changes: 1 addition & 1 deletion ios/flutter_local_authentication.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'flutter_local_authentication'
s.version = '1.1.0'
s.version = '1.2.0'
s.summary = 'A flutter plugin that allows access to Local Authentication'
s.description = <<-DESC
A flutter plugin that allows access to Local Authentication / Biometrics on iOS, macOS, Linux and Android.
Expand Down
2 changes: 1 addition & 1 deletion macos/flutter_local_authentication.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'flutter_local_authentication'
s.version = '1.1.0'
s.version = '1.2.0'
s.summary = 'A flutter plugin that allows access to Local Authentication'
s.description = <<-DESC
A flutter plugin that allows access to Local Authentication / Biometrics on iOS, macOS, Linux and Android.
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: flutter_local_authentication
description: "A flutter plugin that allows access to Local Authentication / Biometrics on iOS, macOS, Linux and Android."
version: 1.1.0
version: 1.2.0
homepage: "https://eaceto.dev"
repository: "https://github.com/eaceto/flutter_local_authentication/"

environment:
sdk: '>=3.1.3 <4.0.0'
flutter: '>=3.3.0'
flutter: '>=3.0.0'

dependencies:
flutter:
Expand Down
27 changes: 13 additions & 14 deletions test/flutter_local_authentication_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ class MockFlutterLocalAuthenticationPlatform
with MockPlatformInterfaceMixin
implements FlutterLocalAuthenticationPlatform {
final _canAuthenticate = true;
double touchIDAuthenticationAllowableReuseDuration = 0.0;
double _touchIDAuthenticationAllowableReuseDuration = 0.0;

@override
Future<bool> authenticate() => Future.value(_canAuthenticate);

@override
Future<double> getTouchIDAuthenticationAllowableReuseDuration() =>
Future.value(touchIDAuthenticationAllowableReuseDuration);
Future.value(_touchIDAuthenticationAllowableReuseDuration);

@override
Future<double> setTouchIDAuthenticationAllowableReuseDuration(
double duration) {
touchIDAuthenticationAllowableReuseDuration = duration;
return Future.value(touchIDAuthenticationAllowableReuseDuration);
_touchIDAuthenticationAllowableReuseDuration = duration;
return Future.value(_touchIDAuthenticationAllowableReuseDuration);
}

@override
Expand Down Expand Up @@ -68,15 +68,14 @@ void main() {
MockFlutterLocalAuthenticationPlatform();
FlutterLocalAuthenticationPlatform.instance = fakePlatform;

expect(
await flutterLocalAuthenticationPlugin
.setTouchIDAuthenticationAllowableReuseDuration(30.0),
30.0);
await flutterLocalAuthenticationPlugin
.setTouchIDAuthenticationAllowableReuseDuration(60.0);
expect(
await flutterLocalAuthenticationPlugin
.getTouchIDAuthenticationAllowableReuseDuration(),
60.0);
double stored = await flutterLocalAuthenticationPlugin
.setTouchIDAuthenticationAllowableReuseDuration(30.0);

expect(stored, 30.0);

stored = await flutterLocalAuthenticationPlugin
.setTouchIDAuthenticationAllowableReuseDuration(45.0);

expect(stored, 45.0);
});
}

0 comments on commit 4f6ffd6

Please sign in to comment.