GardenPlanner/.gitlab-ci.yml

61 lines
1.2 KiB
YAML

stages:
- analyze
- build
analyze:
stage: analyze
image: cirrusci/flutter:latest
before_script:
- cd "$CI_PROJECT_DIR/garden_planner"
script:
- flutter analyze --write=analyzer-output.txt
artifacts:
paths:
- analyzer-output.txt
build:
stage: build
image: cirrusci/flutter:latest
before_script:
- cd "$CI_PROJECT_DIR/garden_planner"
script:
- flutter packages get
- flutter build apk
artifacts:
paths:
- garden_planner/build/app/outputs/apk/release/app-release.apk
test:
stage: build
image: cirrusci/flutter:latest
before_script:
- cd "$CI_PROJECT_DIR/garden_planner"
- flutter packages get
script:
- flutter test --coverage
artifacts:
paths:
- garden_planner/coverage/lcov.info
sonar:
stage: analyze
image:
name: jdwvierling/sonarflutter:1
entrypoint: [""]
variables:
# Defines the location of the analysis task cache
SONAR_USER_HOME: "${CI_PROJECT_DIR}/garden_planner/.sonar"
# Shallow cloning needs to be disabled.
# See https://docs.sonarqube.org/latest/analysis/gitlab-cicd/.
GIT_DEPTH: 0
cache:
key: "${CI_JOB_NAME}"
paths:
- garden_planner/.sonar/cache
script:
- sonar-scanner