Update dart.yml to include code coverage #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#give the pipeline a name | |
name: Dart CI | |
#set conditions to trigger on | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
# define what happens when conditions are met | |
jobs: | |
build: | |
# use ubuntu's latest OS | |
runs-on: ubuntu-latest | |
# use the _/dart container for version 3+ (this makes `dart` available to use) | |
container: | |
image: dart:latest | |
# checkout the code, run pub get and finally run tests | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: dart pub get | |
- name: Run tests | |
run: pub run test --coverage="coverage" | |
- name: Convert coverage to ICOV | |
run: pub run coverage:format_coverage --lcov --in=coverage --out=coverage.lcov --packages=.packages --report-on=lib | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
file: coverage.lcov |