Skip to content
Merged
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
35 changes: 33 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,39 @@ jobs:
- name: Analyze project source
run: flutter analyze --fatal-infos

- name: Run tests
run: flutter test
- name: Run tests with coverage
run: flutter test --coverage

- name: Generate coverage badge
if: github.ref == 'refs/heads/master'
run: |
COVERAGE=$(python3 -c "
import re
with open('coverage/lcov.info') as f:
content = f.read()
total = hit = 0
for block in content.split('end_of_record'):
lf = re.search(r'LF:(\d+)', block)
lh = re.search(r'LH:(\d+)', block)
if lf and lh:
total += int(lf.group(1))
hit += int(lh.group(1))
print(f'{hit/total*100:.0f}' if total else '0')
")
echo "COVERAGE=$COVERAGE" >> $GITHUB_ENV

- name: Create coverage badge
if: github.ref == 'refs/heads/master'
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: ${{ vars.COVERAGE_GIST_ID }}
filename: coverage.json
label: coverage
message: ${{ env.COVERAGE }}%
valColorRange: ${{ env.COVERAGE }}
minColorRange: 50
maxColorRange: 90

- name: Build web
run: flutter build web --release --base-href /
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ html/
# Directory created by dartdoc
doc/api/

# Test coverage
coverage/

# IDE
.idea/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Âm Lịch

[![CI](https://github.com/de-men/amlich/actions/workflows/ci.yml/badge.svg)](https://github.com/de-men/amlich/actions/workflows/ci.yml)
[![codecov](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/thaihuynhxyz/750c80dac4c020472e8510f5ca8c8b7a/raw/coverage.json)](https://github.com/de-men/amlich/actions/workflows/ci.yml)

[A web app](https://amlich.demen.org) that converts between solar (Gregorian) and Vietnamese lunar dates, built with [Flutter for web](https://flutter.dev/web).

Expand Down
1 change: 0 additions & 1 deletion docs/.last_build_id

This file was deleted.

1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/AssetManifest.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/FontManifest.json

This file was deleted.

14,384 changes: 0 additions & 14,384 deletions docs/assets/LICENSE

This file was deleted.

16,835 changes: 0 additions & 16,835 deletions docs/assets/NOTICES

This file was deleted.

Binary file removed docs/assets/fonts/MaterialIcons-Regular.otf
Binary file not shown.
Binary file removed docs/assets/fonts/MaterialIcons-Regular.ttf
Binary file not shown.
Binary file removed docs/assets/fonts/MyFlutterApp.ttf
Binary file not shown.
281 changes: 0 additions & 281 deletions docs/canvaskit/canvaskit.js

This file was deleted.

Binary file removed docs/canvaskit/canvaskit.wasm
Binary file not shown.
21 changes: 0 additions & 21 deletions docs/canvaskit/profiling/canvaskit.js

This file was deleted.

Binary file removed docs/canvaskit/profiling/canvaskit.wasm
Binary file not shown.
Binary file removed docs/favicon.png
Binary file not shown.
193 changes: 0 additions & 193 deletions docs/flutter_service_worker.js

This file was deleted.

21 changes: 0 additions & 21 deletions docs/index.html

This file was deleted.

Loading