Created
February 4, 2021 15:15
-
-
Save zachisit/b6c6758ddebb6a2d8cac0aac70f00e2d to your computer and use it in GitHub Desktop.
Flutter GitLab CI to test, analyze, and run coverage report
This file contains hidden or 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
image: cirrusci/flutter:stable | |
before_script: | |
- flutter pub get | |
- flutter clean | |
- flutter --version | |
- flutter pub global activate junitreport | |
stages: | |
- analyze-and-test | |
analyze-and-test: | |
stage: analyze-and-test | |
script: | |
- export PATH="$PATH":"$HOME/.pub-cache/bin" | |
- flutter build aot | |
- flutter analyze | |
# - flutter test | |
- flutter test --machine | tojunit -o report.xml | |
- flutter test --coverage ./lib | |
- lcov -r coverage/lcov.info '*/__test*__/*' -o coverage/lcov_cleaned.info | |
- genhtml coverage/lcov_cleaned.info --output=coverage | |
artifacts: | |
when: always | |
paths: | |
- rspec.xml | |
- coverage | |
reports: | |
junit: | |
- report.xml | |
only: | |
- master | |
- merge_requests | |
except: | |
variables: | |
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "master" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll need to set a regex line in your Settings->CI->General to have the coverage output returned on the result in the PR screen.