Skip to content

Commit

Permalink
feat: creates leaderboard repository package
Browse files Browse the repository at this point in the history
  • Loading branch information
AyadLaouissi committed Mar 6, 2024
1 parent 35de557 commit f39b43c
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/api_leaderboard_repository.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: api_leaderboard_repository

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

on:
pull_request:
paths:
- "api/packages/leaderboard_repository/**"
- ".github/workflows/api_leaderboard_repository.yaml"
branches:
- main

jobs:
build:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: stable
working_directory: api/packages/leaderboard_repository
7 changes: 7 additions & 0 deletions api/packages/leaderboard_repository/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://www.dartlang.org/guides/libraries/private-files

# Files and directories created by pub
.dart_tool/
.packages
build/
pubspec.lock
62 changes: 62 additions & 0 deletions api/packages/leaderboard_repository/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Leaderboard Repository

Check warning on line 1 in api/packages/leaderboard_repository/README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (Leaderboard)

[![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]

Leaderboard repository

Check warning on line 7 in api/packages/leaderboard_repository/README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (Leaderboard)

## Installation 💻

**❗ In order to start using Leaderboard Repository you must have the [Dart SDK][dart_install_link] installed on your machine.**

Check warning on line 11 in api/packages/leaderboard_repository/README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (Leaderboard)

Install via `dart pub add`:

```sh
dart pub add leaderboard_repository

Check warning on line 16 in api/packages/leaderboard_repository/README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (leaderboard)
```

---

## Continuous Integration 🤖

Leaderboard 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.

Check warning on line 23 in api/packages/leaderboard_repository/README.md

View workflow job for this annotation

GitHub Actions / spell-check / build

Unknown word (Leaderboard)

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 🧪

To run all unit tests:

```sh
dart pub global activate coverage 1.2.0
dart test --coverage=coverage
dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info
```

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
```

[dart_install_link]: https://dart.dev/get-dart
[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_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
1 change: 1 addition & 0 deletions api/packages/leaderboard_repository/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:very_good_analysis/analysis_options.5.1.0.yaml
20 changes: 20 additions & 0 deletions api/packages/leaderboard_repository/coverage_badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// Leaderboard repository
library leaderboard_repository;

export 'src/leaderboard_repository.dart';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// {@template leaderboard_repository}
/// Leaderboard repository
/// {@endtemplate}
class LeaderboardRepository {
/// {@macro leaderboard_repository}
const LeaderboardRepository();
}
12 changes: 12 additions & 0 deletions api/packages/leaderboard_repository/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: leaderboard_repository
description: Leaderboard repository
version: 0.1.0+1
publish_to: none

environment:
sdk: ">=3.0.0 <4.0.0"

dev_dependencies:
mocktail: ^1.0.0
test: ^1.19.2
very_good_analysis: ^5.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// ignore_for_file: prefer_const_constructors
import 'package:leaderboard_repository/leaderboard_repository.dart';
import 'package:test/test.dart';

void main() {
group('LeaderboardRepository', () {
test('can be instantiated', () {
expect(LeaderboardRepository(), isNotNull);
});
});
}

0 comments on commit f39b43c

Please sign in to comment.