Skip to content

Commit

Permalink
improve ci
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel committed Nov 27, 2019
1 parent 848223c commit 2ee8cea
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 43 deletions.
39 changes: 19 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: dart
language: bash
os:
- linux
- osx
env:
# - FLUTTER_CHANNEL="stable"
- FLUTTER_CHANNEL="beta"
sudo: required
dist: trusty
dart:
Expand All @@ -14,27 +17,23 @@ addons:
- libstdc++6
- fonts-droid
before_script:
- git clone https://github.com/flutter/flutter.git -b beta --depth 1
- ./flutter/bin/flutter doctor
- cd ..
- git clone https://github.com/flutter/flutter.git -b $FLUTTER_CHANNEL
- export PATH=$PATH:$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin
- cd -
- flutter doctor
script:
- cd packages/bloc
- pub get
- pub run test_coverage
- cp coverage/lcov.info ../../bloc.lcov
- cd ../bloc_test
- pub get
- pub run test_coverage
- cp coverage/lcov.info ../../bloc_test.lcov
- cd ../angular_bloc
- pub get
- pub upgrade
- pub global activate webdev
- webdev build
- pub run build_runner test --fail-on-severe
- cd ../flutter_bloc
- ../../flutter/bin/flutter test --coverage --coverage-path=../../flutter_bloc.lcov
- set -e
- ./scripts/ci.sh packages/bloc
- ./scripts/ci.sh packages/bloc_test
- ./scripts/ci.sh packages/angular_bloc
- ./scripts/ci.sh packages/flutter_bloc
after_success:
- bash <(curl -s https://codecov.io/bash)
matrix:
fast_finish: true
# allow_failures:
# - env: FLUTTER_CHANNEL="master"
cache:
directories:
- $HOME/.pub-cache
20 changes: 8 additions & 12 deletions packages/angular_bloc/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ environment:
sdk: ">=2.0.0 <3.0.0"

dependencies:
angular: ^5.0.0
angular: ^5.3.0
bloc: ^2.0.0

dependency_overrides:
package_resolver: 1.0.6
stream_transform: 0.0.15

dev_dependencies:
test: ">=1.3.0 <2.0.0"
mockito: ^3.0.0
analyzer: ^0.32.4
build_runner: ^0.9.0
build_test: ^0.10.2+5
build_web_compilers: ^0.4.0+4
source_span: ^1.4.0
angular_test: ^2.3.0
build_runner: ^1.6.0
build_test: ^0.10.8
build_web_compilers: ^2.3.0
pedantic: ^1.8.0
test: ^1.6.0
mockito: ^4.0.0
effective_dart: ^1.1.1
27 changes: 27 additions & 0 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -ex

cd $1
package=${PWD##*/}

if grep -q 'sdk: flutter' "./pubspec.yaml"; then
flutter packages get
flutter format --set-exit-if-changed lib test
flutter analyze --no-current-package lib test/
flutter test --no-pub --coverage
cp ./coverage/lcov.info ../../$package.lcov
elif grep -q 'angular:' "./pubspec.yaml"; then
pub get
dartfmt -w .
dartanalyzer --fatal-infos --fatal-warnings . || EXIT_CODE=$?
pub run build_runner test --fail-on-severe
else
pub get
dartfmt -w .
dartanalyzer --fatal-infos --fatal-warnings . || EXIT_CODE=$?
pub run test_coverage
cp ./coverage/lcov.info ../../$package.lcov
fi

cd -
11 changes: 0 additions & 11 deletions scripts/dartfmt_and_analyze.sh

This file was deleted.

0 comments on commit 2ee8cea

Please sign in to comment.