Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial coveralls setup #165

Merged
merged 2 commits into from
Oct 23, 2024
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
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 @@ -129,6 +139,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 @@ -175,3 +195,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