Skip to content

Commit 7eae081

Browse files
authored
Add github actions for UI packages (#174)
1 parent 8265831 commit 7eae081

15 files changed

+227
-44
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: package:flutter_current_results
2+
permissions: read-all
3+
4+
on:
5+
# Run CI on all PRs (against any branch) and on pushes to the main branch.
6+
pull_request:
7+
paths:
8+
- '.github/workflows/current_results_ui.yaml'
9+
- 'current_results_ui/**'
10+
push:
11+
branches: [ main ]
12+
paths:
13+
- '.github/workflows/current_results_ui.yaml'
14+
- 'current_results_ui/**'
15+
schedule:
16+
- cron: '0 0 * * 0' # weekly
17+
18+
defaults:
19+
run:
20+
working-directory: current_results_ui
21+
22+
jobs:
23+
build:
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
flutterSdk:
29+
- stable
30+
os:
31+
- ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
34+
- name: Cache Pub hosted dependencies
35+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
36+
with:
37+
path: "~/.pub-cache/hosted"
38+
key: "${{ matrix.os }}-${{ matrix.sdk }}"
39+
- uses: subosito/flutter-action@v2
40+
with:
41+
channel: ${{ matrix.flutterSdk }}
42+
cache: true
43+
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
44+
45+
- run: flutter pub get
46+
47+
- run: flutter analyze --fatal-infos
48+
49+
- run: dart format --output=none --set-exit-if-changed .
50+
51+
# TODO: Write tests
52+
# - run: flutter test
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: package:github_label_notifier_ui
2+
permissions: read-all
3+
4+
on:
5+
# Run CI on all PRs (against any branch) and on pushes to the main branch.
6+
pull_request:
7+
paths:
8+
- '.github/workflows/github_label_notifier_ui.yaml'
9+
- 'github-label-notifier/ui/**'
10+
push:
11+
branches: [ main ]
12+
paths:
13+
- '.github/workflows/github_label_notifier_ui.yaml'
14+
- 'github-label-notifier/ui/**'
15+
schedule:
16+
- cron: '0 0 * * 0' # weekly
17+
18+
defaults:
19+
run:
20+
working-directory: github-label-notifier/ui
21+
22+
jobs:
23+
build:
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
sdk:
29+
- 2.10.0 # Does not work on newer SDKs.
30+
os:
31+
- ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
34+
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
35+
name: Cache build_runner results
36+
with:
37+
path: github-label-notifier/ui/.dart_tool/build
38+
key: ${{ matrix.os }}-${{ matrix.sdk }}
39+
- name: Cache Pub hosted dependencies
40+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
41+
with:
42+
path: "~/.pub-cache/hosted"
43+
key: "${{ matrix.os }}-${{ matrix.sdk }}"
44+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
45+
with:
46+
sdk: ${{ matrix.sdk }}
47+
48+
- run: dart pub get
49+
50+
- run: dart format --output=none --set-exit-if-changed .
51+
52+
- run: dart pub run build_runner build
53+
54+
- run: dart analyze --fatal-infos
55+
56+
# TODO: Write tests
57+
# - run: dart pub run build_runner test -- -p chrome
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: package:dart_results_feed
2+
permissions: read-all
3+
4+
on:
5+
# Run CI on all PRs (against any branch) and on pushes to the main branch.
6+
pull_request:
7+
paths:
8+
- '.github/workflows/results_feed.yaml'
9+
- 'results_feed/**'
10+
push:
11+
branches: [ main ]
12+
paths:
13+
- '.github/workflows/results_feed.yaml'
14+
- 'results_feed/**'
15+
schedule:
16+
- cron: '0 0 * * 0' # weekly
17+
18+
defaults:
19+
run:
20+
working-directory: results_feed
21+
22+
jobs:
23+
build:
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
sdk:
29+
- 2.10.0 # Does not work on newer SDKs.
30+
os:
31+
- ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
34+
- name: Cache build_runner results
35+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
36+
with:
37+
path: results_feed/.dart_tool/build
38+
key: ${{ matrix.os }}-${{ matrix.sdk }}
39+
- name: Cache Pub hosted dependencies
40+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
41+
with:
42+
path: "~/.pub-cache/hosted"
43+
key: "${{ matrix.os }}-${{ matrix.sdk }}"
44+
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
45+
with:
46+
sdk: ${{ matrix.sdk }}
47+
48+
- run: dart pub get
49+
50+
- run: dart format --output=none --set-exit-if-changed .
51+
52+
- run: dart pub run build_runner build
53+
54+
- run: dart analyze --fatal-infos
55+
56+
- run: dart pub run build_runner test -- -p chrome -x requires_auth

github-label-notifier/ui/lib/app_component.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import 'dart:async';
66

77
import 'package:angular/angular.dart';
88
import 'package:angular_components/angular_components.dart';
9-
import 'package:angular_components/material_button/material_button.dart';
10-
import 'package:angular_components/material_icon/material_icon.dart';
11-
import 'package:angular_components/material_select/material_dropdown_select.dart';
129

1310
import 'src/services/github_service.dart';
1411
import 'src/services/subscription_service.dart';

github-label-notifier/ui/lib/src/services/subscription_service.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ class SubscriptionsService {
137137
Future<firebase.App> _ensureApp() async {
138138
if (_app == null) {
139139
_app = firebase.initializeApp(
140-
apiKey: "AIzaSyBFKKpPdV3xPQU4jPYiMvUnUfhB5pDDMRI",
141-
authDomain: "dart-ci.firebaseapp.com",
142-
databaseURL: "https://dart-ci.firebaseio.com",
143-
projectId: "dart-ci",
144-
storageBucket: "dart-ci.appspot.com");
140+
apiKey: 'AIzaSyBFKKpPdV3xPQU4jPYiMvUnUfhB5pDDMRI',
141+
authDomain: 'dart-ci.firebaseapp.com',
142+
databaseURL: 'https://dart-ci.firebaseio.com',
143+
projectId: 'dart-ci',
144+
storageBucket: 'dart-ci.appspot.com');
145145
await _app.auth().setPersistence(firebase.Persistence.LOCAL);
146146
}
147147
return _app;
@@ -159,7 +159,7 @@ class SubscriptionsService {
159159

160160
final currentUser = app.auth().currentUser;
161161
final userId = currentUser.uid;
162-
return app.firestore().doc('github-label-subscriptions/${userId}');
162+
return app.firestore().doc('github-label-subscriptions/$userId');
163163
}
164164
}
165165

github-label-notifier/ui/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: src
22
description: UI for managing label subscriptions for GitHub Label Notifier.
33

44
environment:
5-
sdk: '>=2.2.0 <3.0.0'
5+
sdk: '>=2.2.0 <2.12.0' # Pre-null safety only
66

77
dependencies:
88
angular: any

results_feed/dart_test.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tags:
2+
requires_auth: {}
3+
4+
override_platforms:
5+
chrome:
6+
settings:
7+
headless: true

results_feed/lib/src/components/app_component.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:angular/angular.dart';
99
import 'package:angular_components/angular_components.dart';
1010
import 'package:angular_components/material_button/material_button.dart';
1111
import 'package:angular_router/angular_router.dart';
12-
import 'package:dart_results_feed/src/components/results_filter_component.dart';
1312

1413
import 'commit_component.dart';
1514
import 'filter_row_component.dart';

results_feed/lib/src/components/filter_row_component.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class FilterRowComponent implements OnInit {
4949

5050
FilterRowComponent(this.service, this.buildService);
5151

52+
@override
5253
void ngOnInit() async {
5354
final configurations = await buildService.configurations;
5455
selectionOptions = [testSuggestion]

results_feed/lib/src/components/results_filter_component.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ class ResultsFilterComponent {
6868
ResultsFilterComponent(this.service);
6969

7070
String get selectedType => filter.showLatestFailures
71-
? filter.showUnapprovedOnly ? unapprovedFailures : activeFailures
71+
? filter.showUnapprovedOnly
72+
? unapprovedFailures
73+
: activeFailures
7274
: allResults;
7375

7476
void select(String type) {

0 commit comments

Comments
 (0)