Add log context #19
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: Logger | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "master" | |
- "develop" | |
- "dev" | |
- "feature/**" | |
- "bugfix/**" | |
- "hotfix/**" | |
- "support/**" | |
paths: | |
- "lib/**.dart" | |
- "test/**.dart" | |
- "example/**.dart" | |
- "pubspec.yaml" | |
pull_request: | |
branches: | |
- "master" | |
- "develop" | |
- "dev" | |
- "feature/**" | |
- "bugfix/**" | |
- "hotfix/**" | |
- "support/**" | |
paths: | |
- "lib/**.dart" | |
- "test/**.dart" | |
- "example/**.dart" | |
- "pubspec.yaml" | |
jobs: | |
checkout: | |
name: "Checkout" | |
runs-on: ubuntu-latest | |
container: | |
image: dart:beta | |
defaults: | |
run: | |
working-directory: ./ | |
timeout-minutes: 10 | |
steps: | |
- name: ๐ Get latest code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: ๐ Cache pub modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-pub-package | |
with: | |
path: | | |
$PWD/.pub_cache/ | |
key: ${{ runner.os }}-pub-${{ env.cache-name }}-${{ hashFiles('**/pubspec.yaml') }} | |
- name: ๐๏ธ Export pub cache directory | |
run: export PUB_CACHE=$PWD/.pub_cache/ | |
- name: ๐ท Install Dependencies | |
timeout-minutes: 1 | |
run: | | |
dart pub get -C . | |
- name: ๐ Check format | |
timeout-minutes: 1 | |
run: dart format --set-exit-if-changed -l 80 -o none lib/ | |
- name: ๐ Check analyzer | |
timeout-minutes: 1 | |
run: dart analyze --fatal-infos --fatal-warnings lib/ | |
#- name: Check with pana | |
# run: dart pub global activate pana && pana --json --no-warning --line-length 80 | |
- name: ๐งช Run tests | |
run: | | |
dart test --coverage=coverage \ | |
&& dart run coverage:format_coverage --lcov --in=coverage \ | |
--out=coverage/lcov.info --report-on=lib | |
- name: ๐ฅ Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: ๐งฎ Check Code Coverage | |
uses: VeryGoodOpenSource/[email protected] | |
with: | |
path: coverage/lcov.info | |
min_coverage: 90 | |
#exclude: '**.g.dart **.freezed.dart' |