CI #48
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
# Run at 5:00 on Friday to detect broken dependencies and such | |
- cron: '0 5 * * 5' | |
jobs: | |
test: | |
if: ${{ github.event_name != 'release' || github.event.action != 'published' }} | |
strategy: | |
matrix: | |
dart_version: ["3.0", "3.0"] | |
runs-on: ubuntu-latest | |
container: | |
image: dart:${{ matrix.dart_version }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 # needed by codecov | |
- name: Install dependencies | |
# The $(command -v pub...) is a hack so the dart "prefix" is only used | |
# when the pub command is not present | |
run: $(command -v pub || echo dart pub) get | |
- name: Analyze | |
run: dart analyze --fatal-infos | |
- name: Run tests | |
run: $(command -v pub || echo dart pub) run test --coverage=./coverage | |
- name: Convert coverage to LCOV | |
run: $(command -v pub || echo dart pub) run coverage:format_coverage | |
--lcov --packages=.dart_tool/package_config.json --report-on=lib | |
-i coverage -o coverage/lcov.info | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: coverage/lcov.info | |
flags: unit,dart${{ matrix.dart_version }} |