Skip to content

Commit 0da157d

Browse files
committed
ci: setup firebase_dynamic_links ci workflow
1 parent ee442a9 commit 0da157d

File tree

6 files changed

+119
-30
lines changed

6 files changed

+119
-30
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: firebase_dynamic_links
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "packages/firebase_dynamic_links/**"
7+
- ".github/workflows/firebase_dynamic_links.yaml"
8+
push:
9+
branches:
10+
- master
11+
paths-ignore:
12+
- "docs/**"
13+
- "**.md"
14+
15+
env:
16+
FLUTTERFIRE_PLUGIN_SCOPE: "*firebase_dynamic_links*"
17+
FLUTTERFIRE_PLUGIN_SCOPE_EXAMPLE: "*firebase_dynamic_links_example*"
18+
# TODO(Salakar): `flutter_driver` does not yet support NNBD
19+
FLUTTER_COMMAND_FLAGS: "--no-sound-null-safety"
20+
21+
jobs:
22+
android:
23+
if: github.event_name == 'pull_request'
24+
runs-on: macos-latest
25+
timeout-minutes: 30
26+
steps:
27+
- uses: actions/checkout@v1
28+
with:
29+
fetch-depth: 0
30+
- name: "Install Flutter"
31+
run: ./.github/workflows/scripts/install-flutter.sh stable
32+
- name: "Install Tools"
33+
run: ./.github/workflows/scripts/install-tools.sh
34+
- name: "Build Example"
35+
run: ./.github/workflows/scripts/build-example.sh android
36+
- name: "Drive Example"
37+
uses: reactivecircus/android-emulator-runner@v2
38+
with:
39+
api-level: 28
40+
arch: x86_64
41+
# Firebase Database works without Google Play Services, so we don't use the `googleapis`
42+
# emulator target as it's considerably slower on CI.
43+
target: default
44+
profile: Nexus 5X
45+
script: ./.github/workflows/scripts/drive-example.sh android
46+
47+
apple:
48+
runs-on: macos-latest
49+
timeout-minutes: 35
50+
steps:
51+
- uses: actions/checkout@v1
52+
with:
53+
fetch-depth: 0
54+
- name: "Install Flutter"
55+
run: ./.github/workflows/scripts/install-flutter.sh stable
56+
- name: "Install Tools"
57+
run: |
58+
./.github/workflows/scripts/install-tools.sh
59+
flutter config --enable-macos-desktop
60+
- name: "Build iOS Example"
61+
run: ./.github/workflows/scripts/build-example.sh ios
62+
- name: "Drive iOS Example"
63+
run: ./.github/workflows/scripts/drive-example.sh ios
64+
# TODO: Currently does not have macOS support.
65+
# - name: "Build MacOS Example"
66+
# run: ./.github/workflows/scripts/build-example.sh macos
67+
# - name: "Drive MacOS Example"
68+
# run: ./.github/workflows/scripts/drive-example.sh macos

packages/firebase_dynamic_links/example/pubspec.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ dependency_overrides:
2323
path: ../../firebase_core/firebase_core_web
2424

2525
dev_dependencies:
26-
pedantic: ^1.11.0
26+
drive: 0.1.0
27+
flutter_driver:
28+
sdk: flutter
29+
flutter_test:
30+
sdk: flutter
2731

2832
flutter:
2933
uses-material-design: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// @dart = 2.9
2+
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file
3+
// for details. All rights reserved. Use of this source code is governed by a
4+
// BSD-style license that can be found in the LICENSE file.
5+
6+
import 'package:drive/drive.dart' as drive;
7+
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
8+
import 'package:flutter_test/flutter_test.dart';
9+
10+
void testsMain() {
11+
group('DynamicLinks', () {
12+
test('buildUrl', () async {
13+
final DynamicLinkParameters parameters = DynamicLinkParameters(
14+
uriPrefix: 'https://cx4k7.app.goo.gl',
15+
link: Uri.parse('https://dynamic.link.example/helloworld'),
16+
androidParameters: AndroidParameters(
17+
packageName: 'io.flutter.plugins.firebasedynamiclinksexample',
18+
minimumVersion: 0,
19+
),
20+
dynamicLinkParametersOptions: DynamicLinkParametersOptions(
21+
shortDynamicLinkPathLength: ShortDynamicLinkPathLength.short,
22+
),
23+
iosParameters: IosParameters(
24+
bundleId: 'com.google.FirebaseCppDynamicLinksTestApp.dev',
25+
minimumVersion: '0',
26+
),
27+
);
28+
29+
final Uri uri = await parameters.buildUrl();
30+
expect(
31+
uri.toString(),
32+
'https://cx4k7.app.goo.gl?amv=0&apn=io.flutter.plugins.firebasedynamiclinksexample&ibi=com.google.FirebaseCppDynamicLinksTestApp.dev&imv=0&link=https%3A%2F%2Fdynamic.link.example%2Fhelloworld',
33+
);
34+
});
35+
});
36+
}
37+
38+
void main() => drive.main(testsMain);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// @dart = 2.9
2+
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file
3+
// for details. All rights reserved. Use of this source code is governed by a
4+
// BSD-style license that can be found in the LICENSE file.
5+
6+
import 'package:drive/drive_driver.dart' as drive;
7+
8+
void main() => drive.main();

packages/firebase_dynamic_links/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ dependencies:
1717
dev_dependencies:
1818
flutter_test:
1919
sdk: flutter
20-
pedantic: ^1.11.0
2120
url_launcher: ^6.0.2
2221

2322
flutter:

packages/firebase_dynamic_links/test/firebase_dynamic_links_e2e.dart

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)