Skip to content

Commit

Permalink
Initial coveralls setup (#165)
Browse files Browse the repository at this point in the history
* Initial coveralls setup

* Add badge to README.md
  • Loading branch information
jonasfj authored Oct 23, 2024
1 parent 1013ffb commit 3fc6c63
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ jobs:
--target=integration_test/webcrypto_test.dart \
-d chrome
- run: xvfb-run flutter pub run test -p vm,chrome,firefox
# Test with coverage collection as a separate step.
# This will run in debug mode, so we test both with and without coverage.
- run: xvfb-run flutter pub run test -p vm,chrome,firefox --coverage ./coverage
# Report collected coverage
- name: Convert coverage to lcov
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
- uses: coverallsapp/github-action@v2
with:
flag-name: linux
parallel: true
macos-14:
name: webcrypto on macOS 14 desktop / Chrome
runs-on: macos-14 # Test with xcode 15
Expand Down Expand Up @@ -141,6 +151,16 @@ jobs:
--target=integration_test/webcrypto_test.dart \
-d chrome
- run: flutter pub run test -p vm,chrome,firefox
# Test with coverage collection as a separate step.
# This will run in debug mode, so we test both with and without coverage.
- run: xvfb-run flutter pub run test -p vm,chrome,firefox --coverage ./coverage
# Report collected coverage
- name: Convert coverage to lcov
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
- uses: coverallsapp/github-action@v2
with:
flag-name: windows
parallel: true
ios:
name: webcrypto on iOS emulator (iPhone)
runs-on: macos-14
Expand Down Expand Up @@ -187,3 +207,13 @@ jobs:
api-level: 28
working-directory: ./example
script: flutter test integration_test/webcrypto_test.dart -d android
coverage:
name: Report to coveralls
runs-on: ubuntu-latest
needs:
- linux
- windows
steps:
- uses: coverallsapp/github-action@v2
with:
parallel-finished: true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Future<void> main() async {
}
```

[![Coverage Status](https://coveralls.io/repos/github/google/webcrypto.dart/badge.svg?branch=master)](https://coveralls.io/github/google/webcrypto.dart?branch=master)

**Features:**
* Get random bytes
* Digest (sha-1/sha-256/sha-384/sha-512)
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dev_dependencies:
flutter_lints: ^4.0.0
flutter_test:
sdk: flutter
coverage: any # we only need format_coverage, don't care what version

flutter:
plugin:
Expand Down

0 comments on commit 3fc6c63

Please sign in to comment.