diff --git a/.github/workflows/board_info_repository.yaml b/.github/workflows/board_info_repository.yaml new file mode 100644 index 000000000..bd37d88ca --- /dev/null +++ b/.github/workflows/board_info_repository.yaml @@ -0,0 +1,20 @@ +name: board_info_repository + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + paths: + - "packages/board_info_repository/**" + - ".github/workflows/board_info_repository.yaml" + branches: + - main + +jobs: + build: + uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 + with: + flutter_channel: stable + working_directory: packages/board_info_repository diff --git a/packages/board_info_repository/.gitignore b/packages/board_info_repository/.gitignore new file mode 100644 index 000000000..06ef8e610 --- /dev/null +++ b/packages/board_info_repository/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# VSCode related +.vscode/* + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ +pubspec.lock + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Test related +coverage \ No newline at end of file diff --git a/packages/board_info_repository/README.md b/packages/board_info_repository/README.md new file mode 100644 index 000000000..9634ef5fd --- /dev/null +++ b/packages/board_info_repository/README.md @@ -0,0 +1,67 @@ +# Board Info Repository + +[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] +[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason) +[![License: MIT][license_badge]][license_link] + +A repository to manage the general board information and parameters + +## Installation ๐Ÿ’ป + +**โ— In order to start using Board Info Repository you must have the [Flutter SDK][flutter_install_link] installed on your machine.** + +Install via `flutter pub add`: + +```sh +dart pub add board_info_repository +``` + +--- + +## Continuous Integration ๐Ÿค– + +Board Info Repository comes with a built-in [GitHub Actions workflow][github_actions_link] powered by [Very Good Workflows][very_good_workflows_link] but you can also add your preferred CI/CD solution. + +Out of the box, on each pull request and push, the CI `formats`, `lints`, and `tests` the code. This ensures the code remains consistent and behaves correctly as you add functionality or make changes. The project uses [Very Good Analysis][very_good_analysis_link] for a strict set of analysis options used by our team. Code coverage is enforced using the [Very Good Workflows][very_good_coverage_link]. + +--- + +## Running Tests ๐Ÿงช + +For first time users, install the [very_good_cli][very_good_cli_link]: + +```sh +dart pub global activate very_good_cli +``` + +To run all unit tests: + +```sh +very_good test --coverage +``` + +To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov). + +```sh +# Generate Coverage Report +genhtml coverage/lcov.info -o coverage/ + +# Open Coverage Report +open coverage/index.html +``` + +[flutter_install_link]: https://docs.flutter.dev/get-started/install +[github_actions_link]: https://docs.github.com/en/actions/learn-github-actions +[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg +[license_link]: https://opensource.org/licenses/MIT +[logo_black]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_black.png#gh-light-mode-only +[logo_white]: https://raw.githubusercontent.com/VGVentures/very_good_brand/main/styles/README/vgv_logo_white.png#gh-dark-mode-only +[mason_link]: https://github.com/felangel/mason +[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg +[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis +[very_good_cli_link]: https://pub.dev/packages/very_good_cli +[very_good_coverage_link]: https://github.com/marketplace/actions/very-good-coverage +[very_good_ventures_link]: https://verygood.ventures +[very_good_ventures_link_light]: https://verygood.ventures#gh-light-mode-only +[very_good_ventures_link_dark]: https://verygood.ventures#gh-dark-mode-only +[very_good_workflows_link]: https://github.com/VeryGoodOpenSource/very_good_workflows diff --git a/packages/board_info_repository/analysis_options.yaml b/packages/board_info_repository/analysis_options.yaml new file mode 100644 index 000000000..799268d3e --- /dev/null +++ b/packages/board_info_repository/analysis_options.yaml @@ -0,0 +1 @@ +include: package:very_good_analysis/analysis_options.5.1.0.yaml diff --git a/packages/board_info_repository/coverage_badge.svg b/packages/board_info_repository/coverage_badge.svg new file mode 100644 index 000000000..499e98ce2 --- /dev/null +++ b/packages/board_info_repository/coverage_badge.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + coverage + coverage + 100% + 100% + + diff --git a/packages/board_info_repository/lib/board_info_repository.dart b/packages/board_info_repository/lib/board_info_repository.dart new file mode 100644 index 000000000..ec7206d46 --- /dev/null +++ b/packages/board_info_repository/lib/board_info_repository.dart @@ -0,0 +1,4 @@ +/// A repository to manage the general board information and parameters +library; + +export 'src/board_info_repository.dart'; diff --git a/packages/board_info_repository/lib/src/board_info_repository.dart b/packages/board_info_repository/lib/src/board_info_repository.dart new file mode 100644 index 000000000..a0d2834dd --- /dev/null +++ b/packages/board_info_repository/lib/src/board_info_repository.dart @@ -0,0 +1,7 @@ +/// {@template board_info_repository} +/// A repository to manage the general board information and parameters +/// {@endtemplate} +class BoardInfoRepository { + /// {@macro board_info_repository} + const BoardInfoRepository(); +} diff --git a/packages/board_info_repository/pubspec.yaml b/packages/board_info_repository/pubspec.yaml new file mode 100644 index 000000000..46c670f68 --- /dev/null +++ b/packages/board_info_repository/pubspec.yaml @@ -0,0 +1,18 @@ +name: board_info_repository +description: A repository to manage the general board information and parameters +version: 0.1.0+1 +publish_to: none + +environment: + sdk: "^3.3.0" + flutter: "^3.19.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + flutter_test: + sdk: flutter + mocktail: ^1.0.3 + very_good_analysis: ^5.1.0 diff --git a/packages/board_info_repository/test/src/board_info_repository_test.dart b/packages/board_info_repository/test/src/board_info_repository_test.dart new file mode 100644 index 000000000..c791bca5c --- /dev/null +++ b/packages/board_info_repository/test/src/board_info_repository_test.dart @@ -0,0 +1,12 @@ +// ignore_for_file: prefer_const_constructors + +import 'package:board_info_repository/board_info_repository.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('BoardInfoRepository', () { + test('can be instantiated', () { + expect(BoardInfoRepository(), isNotNull); + }); + }); +}