diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index 6061d58..b4acc1c 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -14,7 +14,7 @@ jobs: flutter-version: '1.17.3' channel: 'stable' - name: Flutter analyze - run: flutter analyze > flutter_analyze_report.txt + run: ./scripts/analyze.sh - name: Cache bundle uses: actions/cache@v1 with: diff --git a/scripts/analyze.sh b/scripts/analyze.sh new file mode 100755 index 0000000..87a134e --- /dev/null +++ b/scripts/analyze.sh @@ -0,0 +1,11 @@ +result=$(flutter analyze) +if [ $? -ne 0 ]; then + echo "$result" | grep -E 'error.+\.dart:\d+:\d+' + if [ $? -eq 0 ]; then + echo "$result" + exit 1 + fi +fi +echo "$result" > flutter_analyze_report.txt +echo "$result" +exit 0