Skip to content

fix: fix actions

fix: fix actions #32

Workflow file for this run

name: test
on:
pull_request:
paths-ignore:
- '**.md'
push:
branches:
- master
- releases/*
paths-ignore:
- '**.md'
jobs:
test:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
# Caching for Unix-like OPs
- uses: actions/cache@v3
if: ${{ !startsWith(matrix.operating-system, 'windows') }}
with:
path: '~/.pub-cache'
key: ${{ runner.os }}-${{ hashFiles('pubspec.yaml') }}
# Caching on Windows.
- uses: actions/cache@v3
if: ${{ startsWith(matrix.operating-system, 'windows') }}
with:
path: '%LOCALAPPDATA%\Pub\Cache'
key: ${{ runner.os }}-${{ hashFiles('pubspec.yaml') }}
- name: Setup Dart VM
uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: dart format --output=none --set-exit-if-changed .
- run: dart analyze
- run: dart test
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: '~/.pub-cache'
key: ${{ runner.os }}-${{ hashFiles('pubspec.yaml') }}
- name: Setup Dart VM
uses: dart-lang/setup-dart@v1
- run: dart pub get
- name: Collect coverate
run: |
set -e
echo "Installing coverage tool"
pub global activate coverage &>/dev/null
echo "Collecting coverage on port 9292..."
dart --disable-service-auth-codes \
--enable-vm-service=9292 \
--pause-isolates-on-exit \
test/all.dart &
echo "Generating LCOV report..."
pub global run coverage:collect_coverage \
--port=9292 \
--out=.coverage/coverage.json \
--wait-paused \
--resume-isolates && \
pub global run coverage:format_coverage \
--lcov \
--in=.coverage/coverage.json \
--out=.coverage/lcov.info \
--packages=.packages \
--report-on=lib \
--check-ignore
shell: bash
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: .coverage/lcov.info
fail_ci_if_error: true