Generate & deploy test coverage for Dart & Flutter apps in a monorepo.
Currently
- Calculates coverage and generates a html summary
- Deploys the summary to Firebase Hosting.
Future Work
- Adds a comment to the PR with the coverage and whether it is a passing number.
Setup guides can be found in the User Docs.
Add a workflow (eg. .github/workflows/main.yml):
name: Deploy coverage on each PR
on:
pull_request:
jobs:
build_and_preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: enspyrco/test-coverage-action@v0
with:
site_id: enspyrco
service_account_key: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
packages_path: packages/
package_name: ${{ matrix.package_name }}Note: FIREBASE_SERVICE_ACCOUNT may be named differently by the Firebase CLI. Use whatever the tool tells you to.
This is a service account JSON key. The easiest way to set it up is to run firebase init hosting:github. However, it can also be created manually then stored as an
encrypted secret.
Identifies the firebase hosting site that will be used. If you only have one site, the site id is the project id.
If there is a .firebaserc in the project directory, you can leave this option out and the project id will be used.
If the project is a multi-package (monorepo) project, provide the path to the packages.
If the project is a multi-package (monorepo) project, provide the package name.