From a7b65f293390eae44f6e78bb942a70108269ee78 Mon Sep 17 00:00:00 2001 From: Tommaso Barbugli Date: Thu, 20 Feb 2020 13:23:00 +0100 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..6e56f2be --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + release: + types: + - created + +env: + flutter_version: "1.12.13+hotfix.5" + +jobs: + test: + runs-on: [ubuntu-latest] + steps: + - uses: actions/checkout@v2 + - name: Cache Flutter dependencies + id: cache + uses: actions/cache@v1 + with: + path: /opt/hostedtoolcache/flutter + key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }} + - name: Flutter action + uses: subosito/flutter-action@v1.1.1 + with: + flutter-version: ${{ env.flutter_version }} + - name: Get dependencies + run: flutter pub get + - name: Coverage fix + run: | + file=test/coverage_helper_test.dart + echo "// Helper file to make coverage work for all dart files\n" > $file + echo "// ignore_for_file: unused_import" >> $file + find lib -name '*.dart' | grep -e '[^g]\.dart' | grep -v '_html.dart' | cut -c4- | awk -v package=stream_chat_flutter '{printf "import '\''package:%s%s'\'';\n", package, $1}' >> $file + echo "" >> $file + echo "void main(){}" >> $file + cat $file + - name: Run tests + run: flutter test --coverage + - name: Codecov + run: bash <(curl -s https://codecov.io/bash) -c -t ${{ secrets.CODECOV_TOKEN }} -f coverage/lcov.info -F flutter_tool