Skip to content

Commit

Permalink
chore: add melos, test in CI, add codecov (#16)
Browse files Browse the repository at this point in the history
* add melos

* update ci name

* update README files

* fix links
  • Loading branch information
josxha authored Feb 6, 2024
1 parent 5c4c9d4 commit 2c5536a
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 60 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/build-android.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Test & Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

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

jobs:
test:
runs-on: ubuntu-latest
name: Build Android
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Install melos
run: dart pub global activate melos
- name: Install coverde
run: dart pub global activate coverde
- name: Bootstrap melos
run: melos bootstrap
- name: Run tests with coverage
run: melos run test_with_coverage --no-select
- name: Run Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
build-android:
runs-on: ubuntu-latest
name: Build Android
needs: [ test ]
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '21'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Build APK
working-directory: example
run: flutter build apk
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: apk
path: example/build/app/outputs/flutter-apk/app-release.apk
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ build/

# ignore coverage info
**/coverage/lcov.info
coverage/filtered.lcov.info
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ functionality of [flutter_map](https://pub.dev/packages/flutter_map).
A combined example app can be found under
[./example](https://github.com/josxha/flutter_map_plugins).

[![stars](https://badgen.net/github/stars/josxha/flutter_map_plugins?label=stars&color=green&icon=github)](https://github.com/josxha/flutter_map_plugins/stargazers)
[![codecov](https://codecov.io/gh/josxha/flutter_map_plugins/graph/badge.svg?token=5045489G7X)](https://codecov.io/gh/josxha/flutter_map_plugins)

[![GitHub last commit](https://img.shields.io/github/last-commit/josxha/flutter_map_plugins)](https://github.com/josxha/flutter_map_plugins)
[![Issues](https://img.shields.io/github/issues/josxha/flutter_map_plugins)](https://github.com/josxha/flutter_map_plugins/issues)
[![Open PRs](https://badgen.net/github/open-prs/josxha/flutter_map_cache?label=Open+PRs&color=green)](https://GitHub.com/josxha/flutter_map_plugins/pulls)

### [flutter_map_cache](https://pub.dev/packages/flutter_map_cache)

A slim yet powerful caching plugin for flutter_map tile layers. Supports any
Expand Down
23 changes: 13 additions & 10 deletions flutter_map_cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

A slim yet powerful caching plugin for flutter_map tile layers.

![Pub Likes](https://img.shields.io/pub/likes/flutter_map_cache)
![Pub Points](https://img.shields.io/pub/points/flutter_map_cache)
![Pub Popularity](https://img.shields.io/pub/popularity/flutter_map_cache)
![Pub Version](https://img.shields.io/pub/v/flutter_map_cache)
[![Pub Version](https://img.shields.io/pub/v/flutter_map_cache)](https://pub.dev/packages/flutter_map_cache)
[![likes](https://img.shields.io/pub/likes/flutter_map_cache?logo=flutter)](https://pub.dev/packages/flutter_map_cache)
[![Pub Points](https://img.shields.io/pub/points/flutter_map_cache)](https://pub.dev/packages/flutter_map_cache/score)
[![Pub Popularity](https://img.shields.io/pub/popularity/flutter_map_cache)](https://pub.dev/packages/flutter_map_cache)

![GitHub last commit](https://img.shields.io/github/last-commit/josxha/flutter_map_plugins)
![GitHub issues](https://img.shields.io/github/issues/josxha/flutter_map_plugins)
![GitHub Repo stars](https://img.shields.io/github/stars/josxha/flutter_map_plugins?style=social)
[![GitHub last commit](https://img.shields.io/github/last-commit/josxha/flutter_map_plugins)](https://github.com/josxha/flutter_map_plugins)
[![stars](https://badgen.net/github/stars/josxha/flutter_map_plugins?label=stars&color=green&icon=github)](https://github.com/josxha/flutter_map_plugins/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/josxha/flutter_map_plugins)](https://github.com/josxha/flutter_map_plugins/issues)
[![codecov](https://codecov.io/gh/josxha/flutter_map_plugins/graph/badge.svg?token=5045489G7X)](https://codecov.io/gh/josxha/flutter_map_plugins)

## Motivation

Expand Down Expand Up @@ -81,7 +82,7 @@ dependencies:
## Usage
Using the cache is easy. Here are examples how to use some of the storage
Using the cache is easy. Here are examples how to use some of the storage
backends:
### Hive
Expand Down Expand Up @@ -269,7 +270,9 @@ web.
<summary>Click here to expand / hide.</summary>

Yes. This package includes the tile cancellation out of the box.
There is no need for [flutter_map_cancellable_tile_provider](https://pub.dev/packages/flutter_map_cancellable_tile_provider/) when using
There is no need
for [flutter_map_cancellable_tile_provider](https://pub.dev/packages/flutter_map_cancellable_tile_provider/)
when using
this package.

---
Expand Down Expand Up @@ -314,7 +317,7 @@ show up on the map.
downloading (more than 250 tiles on a higher zoom level) of tiles in their
[tile usage policy](https://operations.osmfoundation.org/policies/tiles/).
If you use a paid tile provider, bulk-downloading can cause high costs if
you pay per tile request. Using a proper offline map solution
you pay per tile request. Using a proper offline map solution
(e.g. MBTiles or PMTiles) would be my recommendation here.

If you still need bulk-downloading functionality you can check out the package
Expand Down
15 changes: 8 additions & 7 deletions flutter_map_pmtiles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

A TileProvider for flutter_map that adds support for PMTiles.

![Pub Likes](https://img.shields.io/pub/likes/flutter_map_pmtiles)
![Pub Points](https://img.shields.io/pub/points/flutter_map_pmtiles)
![Pub Popularity](https://img.shields.io/pub/popularity/flutter_map_pmtiles)
![Pub Version](https://img.shields.io/pub/v/flutter_map_pmtiles)
[![Pub Version](https://img.shields.io/pub/v/flutter_map_pmtiles)](https://pub.dev/packages/flutter_map_pmtiles)
[![likes](https://img.shields.io/pub/likes/flutter_map_pmtiles?logo=flutter)](https://pub.dev/packages/flutter_map_pmtiles)
[![Pub Points](https://img.shields.io/pub/points/flutter_map_pmtiles)](https://pub.dev/packages/flutter_map_pmtiles/score)
[![Pub Popularity](https://img.shields.io/pub/popularity/flutter_map_pmtiles)](https://pub.dev/packages/flutter_map_pmtiles)

![GitHub last commit](https://img.shields.io/github/last-commit/josxha/flutter_map_plugins)
![GitHub issues](https://img.shields.io/github/issues/josxha/flutter_map_plugins)
![GitHub Repo stars](https://img.shields.io/github/stars/josxha/flutter_map_plugins?style=social)
[![GitHub last commit](https://img.shields.io/github/last-commit/josxha/flutter_map_plugins)](https://github.com/josxha/flutter_map_plugins)
[![stars](https://badgen.net/github/stars/josxha/flutter_map_plugins?label=stars&color=green&icon=github)](https://github.com/josxha/flutter_map_plugins/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/josxha/flutter_map_plugins)](https://github.com/josxha/flutter_map_plugins/issues)
[![codecov](https://codecov.io/gh/josxha/flutter_map_plugins/graph/badge.svg?token=5045489G7X)](https://codecov.io/gh/josxha/flutter_map_plugins)

## Getting started

Expand Down
19 changes: 19 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: flutter_map_plugins
packages:
- flutter_map_*
- vector_map_tiles_*

scripts:
analyze:
description: Run `dart analyze` in all packages
run: melos exec dart analyze .
test:
description: Run tests of all packages
run: melos exec --dir-exists="test" --fail-fast flutter test --no-pub
test_with_coverage:
description: Run tests of all packages with coverage and merge its results
run: |
melos exec rm -rf coverage
melos exec --dir-exists="test" --fail-fast flutter test --no-pub -r expanded --coverage
melos exec -c 1 --file-exists=coverage/lcov.info coverde filter --input ./coverage/lcov.info --output MELOS_ROOT_PATH/coverage/filtered.lcov.info --filters \.g\.dart
coverde value -i coverage/filtered.lcov.info > MELOS_ROOT_PATH/coverage/result.txt
7 changes: 7 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: flutter_map_plugins

environment:
sdk: ">=2.18.0 <3.0.0"

dev_dependencies:
melos: ^4.0.0
28 changes: 16 additions & 12 deletions vector_map_tiles_pmtiles/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# flutter_map_pmtiles
# vector_map_tiles_pmtiles

A TileProvider for flutter_map that adds support for PMTiles.

![Pub Likes](https://img.shields.io/pub/likes/flutter_map_pmtiles)
![Pub Points](https://img.shields.io/pub/points/flutter_map_pmtiles)
![Pub Popularity](https://img.shields.io/pub/popularity/flutter_map_pmtiles)
![Pub Version](https://img.shields.io/pub/v/flutter_map_pmtiles)
[![Pub Version](https://img.shields.io/pub/v/vector_map_tiles_pmtiles)](https://pub.dev/packages/vector_map_tiles_pmtiles)
[![likes](https://img.shields.io/pub/likes/vector_map_tiles_pmtiles?logo=flutter)](https://pub.dev/packages/vector_map_tiles_pmtiles)
[![Pub Points](https://img.shields.io/pub/points/vector_map_tiles_pmtiles)](https://pub.dev/packages/vector_map_tiles_pmtiles/score)
[![Pub Popularity](https://img.shields.io/pub/popularity/vector_map_tiles_pmtiles)](https://pub.dev/packages/vector_map_tiles_pmtiles)

![GitHub last commit](https://img.shields.io/github/last-commit/josxha/flutter_map_plugins)
![GitHub issues](https://img.shields.io/github/issues/josxha/flutter_map_plugins)
![GitHub Repo stars](https://img.shields.io/github/stars/josxha/flutter_map_plugins?style=social)
[![GitHub last commit](https://img.shields.io/github/last-commit/josxha/flutter_map_plugins)](https://github.com/josxha/flutter_map_plugins)
[![stars](https://badgen.net/github/stars/josxha/flutter_map_plugins?label=stars&color=green&icon=github)](https://github.com/josxha/flutter_map_plugins/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/josxha/flutter_map_plugins)](https://github.com/josxha/flutter_map_plugins/issues)
[![codecov](https://codecov.io/gh/josxha/flutter_map_plugins/graph/badge.svg?token=5045489G7X)](https://codecov.io/gh/josxha/flutter_map_plugins)

## Getting started

Expand All @@ -18,7 +19,7 @@ Add the following packages to your `pubspec.yaml` file:
```yaml
dependencies:
flutter_map: ^6.0.0 # in case you don't have it yet
flutter_map_pmtiles: ^1.0.0 # this package
vector_map_tiles_pmtiles: ^1.0.0 # this package
```
## Usage
Expand All @@ -27,14 +28,17 @@ dependencies:
```dart
// ...from an URL
final Future<PmTilesVectorTileProvider> _futureTileProvider = PmTilesVectorTileProvider
final Future<
PmTilesVectorTileProvider> _futureTileProvider = PmTilesVectorTileProvider
.fromSource('https://example.com/useYourOwnHostedPMTilesFile.pmtiles');
// ...from an local file on the file system
final Future<PmTilesVectorTileProvider> _futureTileProvider = PmTilesVectorTileProvider
final Future<
PmTilesVectorTileProvider> _futureTileProvider = PmTilesVectorTileProvider
.fromSource('some/file/system/path.pmtiles');
// ...or provide a PmTilesArchive directly
// (you'll need to add pmtiles as direct dependency to your project)
final Future<PmTilesVectorTileProvider> _futureTileProvider = PmTilesVectorTileProvider
final Future<
PmTilesVectorTileProvider> _futureTileProvider = PmTilesVectorTileProvider
.fromArchive(somePmTilesArchive);
```

Expand Down

0 comments on commit 2c5536a

Please sign in to comment.