Update ci workflow file #243
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
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_call: | |
jobs: | |
run-tests: | |
name: Run tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dart-lang/setup-dart@v1 | |
- name: Install dart dependencies | |
run: dart pub get | |
- name: Analyze package | |
run: dart analyze lib test example | |
- name: Verify package formatting | |
run: dart format --set-exit-if-changed lib test example | |
- name: Run tests and generate coverage reports | |
run: | | |
dart test --reporter=github --coverage=./coverage/reports | |
dart pub global activate coverage | |
dart pub global run coverage:format_coverage --report-on=./lib --lcov --in=./coverage/reports --out=coverage/lcov.info | |
- if: matrix.os == 'ubuntu-latest' | |
name: Report to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
file: coverage/lcov.info | |
fail_ci_if_error: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |