Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add github action #1

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/gibsonify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: gibsonify
on: pull_request

jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1

# A custom job which generates and uploads the package's dependency graph
# Only runs when the build job has completed successfully.
visualize:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
- name: Generate Dependency Graph
env:
FLUTTER_DART_HOME: ${{ env.FLUTTER_HOME }}/bin/cache/dart-sdk/bin
FLUTTER_PUB_CACHE: ${{env.FLUTTER_HOME}}/.pub-cache/bin
run: |
flutter pub global activate pubviz
export PATH=$PATH:$FLUTTER_DART_HOME
export PATH=$PATH:$FLUTTER_PUB_CACHE
pubviz print -d > pubviz.html

- name: Upload Dependency Graph
uses: actions/upload-artifact@v1
with:
name: dependency-graph
path: pubviz.html
1 change: 0 additions & 1 deletion lib/collection/bloc/collection_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ class CollectionBloc extends Bloc<CollectionEvent, CollectionState> {
emit(state.copyWith(gibsonsForm: changedGibsonsForm));
} else {
// TODO: handle item not found case
print('food item not found!'); // TODO: delete
emit(state);
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/collection/widgets/fourth_pass_food_item_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class FourthPassFoodItemCard extends StatelessWidget {
TextFormField(
readOnly: true,
initialValue: foodItem.recipe?.recipeName.value ?? '',
decoration: InputDecoration(
icon: const Icon(Icons.bookmark),
decoration: const InputDecoration(
icon: Icon(Icons.bookmark),
labelText: 'Food recipe',
helperText: 'What is the recipe of this food',
// TODO:
Expand Down
4 changes: 2 additions & 2 deletions lib/collection/widgets/second_pass_food_item_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class SecondPassFoodItemCard extends StatelessWidget {
initialValue: foodItem.recipe?.recipeName.value ?? '',
readOnly: true,
key: UniqueKey(),
decoration: InputDecoration(
icon: const Icon(Icons.bookmark),
decoration: const InputDecoration(
icon: Icon(Icons.bookmark),
labelText: 'Food recipe',
helperText: 'What is the recipe of this food',
// TODO:
Expand Down
3 changes: 1 addition & 2 deletions lib/collection/widgets/sensitization_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,5 @@ class InterviewStartTimeInput extends StatelessWidget {
}
}


// Or perhaps make the bottom navigation bar be a part of the state and only
// Or perhaps make the bottom navigation bar be a part of the state and only
// allow to pass to next one if previous one is complete
2 changes: 1 addition & 1 deletion lib/home/bloc/home_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> {

HomeBloc({required GibsonifyRepository gibsonifyRepository})
: _gibsonifyRepository = gibsonifyRepository,
super(HomeState()) {
super(const HomeState()) {
// TODO: implement a subscription to a stream of GibsonsForms
on<GibsonsFormsLoaded>(_onGibsonsFormsLoaded);
on<GibsonsFormDeleted>(_onGibsonsFormDeleted);
Expand Down
10 changes: 5 additions & 5 deletions packages/gibsonify_api/lib/src/models/food_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FoodItem extends Equatable {
confirmed = json['confirmed'] == 'true' ? true : false;

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['name'] = name.toJson();
data['timePeriod'] = timePeriod.toJson();
Expand Down Expand Up @@ -156,7 +156,7 @@ class TimePeriod extends FormzInput<String, TimePeriodValidationError> {
final _allowedTimePeriod = const ['morning', 'afternoon', 'evening', 'night'];

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand Down Expand Up @@ -194,7 +194,7 @@ class Source extends FormzInput<String, SourceValidationError> {
];

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand Down Expand Up @@ -264,7 +264,7 @@ class PreparationMethod
];

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand Down Expand Up @@ -331,7 +331,7 @@ class MeasurementValue
const MeasurementValue.dirty([String value = '']) : super.dirty(value);

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand Down
22 changes: 11 additions & 11 deletions packages/gibsonify_api/lib/src/models/gibsons_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class GibsonsForm extends Equatable {
foodItems = _jsonDecodeFoodItems(json['foodItems']);

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['householdId'] = householdId.toJson();
data['respondentName'] = respondentName.toJson();
Expand Down Expand Up @@ -158,7 +158,7 @@ class HouseholdId extends FormzInput<String, HouseholdIdValidationError> {
// Formz completely. It might be easier to just have all these values
// as strings and implement a couple of validator methods in GibsonsForm
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand All @@ -181,7 +181,7 @@ class RespondentName extends FormzInput<String, RespondentNameValidationError> {
const RespondentName.dirty([String value = '']) : super.dirty(value);

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand All @@ -206,7 +206,7 @@ class RespondentTelNumber
const RespondentTelNumber.dirty([String value = '']) : super.dirty(value);

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand All @@ -233,7 +233,7 @@ class SensitizationDate
const SensitizationDate.dirty([String value = '']) : super.dirty(value);

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand Down Expand Up @@ -269,7 +269,7 @@ class RecallDay extends FormzInput<String, RecallDayValidationError> {
];

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand All @@ -294,7 +294,7 @@ class InterviewDate extends FormzInput<String, InterviewDateValidationError> {
const InterviewDate.dirty([String value = '']) : super.dirty(value);

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand All @@ -320,7 +320,7 @@ class InterviewStartTime
const InterviewStartTime.dirty([String value = '']) : super.dirty(value);

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand All @@ -346,7 +346,7 @@ class InterviewEndTime
const InterviewEndTime.dirty([String value = '']) : super.dirty(value);

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand Down Expand Up @@ -381,7 +381,7 @@ class InterviewOutcome
];

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand All @@ -407,7 +407,7 @@ class Comments extends FormzInput<String, CommentsValidationError> {
const Comments.dirty([String value = '']) : super.dirty(value);

Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
final Map<String, dynamic> data = <String, dynamic>{};
data['value'] = value;
data['pure'] = pure.toString();
return data;
Expand Down
4 changes: 2 additions & 2 deletions packages/gibsonify_api/test/gibsonify_api_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:gibsonify_api/gibsonify_api.dart';
import 'package:test/test.dart';
// import 'package:gibsonify_api/gibsonify_api.dart';
// import 'package:test/test.dart';

// TODO: write tests
// void main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:gibsonify_repository/gibsonify_repository.dart';

import 'package:gibsonify_api/gibsonify_api.dart';

/// Repository that handles requests for GibsonsForms and Recipes
Expand Down
25 changes: 13 additions & 12 deletions packages/gibsonify_repository/test/gibsonify_repository_test.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import 'package:gibsonify_repository/gibsonify_repository.dart';
// import 'package:gibsonify_repository/gibsonify_repository.dart';
import 'package:test/test.dart';

// TODO: write tests
// void main() {
// group('A group of tests', () {
// final awesome = Awesome();
// TODO: ahha, evidently this doesn't run!
void main() {
group('A group of tests', () {
const awesome = true;

// setUp(() {
// // Additional setup goes here.
// });
setUp(() {
// Additional setup goes here.
});

// test('First Test', () {
// expect(awesome.isAwesome, isTrue);
// });
// });
// }
test('First Test', () {
expect(awesome, isTrue);
});
});
}
19 changes: 18 additions & 1 deletion test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,21 @@

// TODO: add tests

void main() {}
// void main() {}

import 'package:test/test.dart';

// TODO: write tests
void main() {
group('A group of tests', () {
const awesome = true;

setUp(() {
// TODO: Additional setup goes here.
});

test('First Test', () {
expect(awesome, isTrue);
});
});
}