GardenPlanner/.gitlab-ci.yml

58 lines
1.1 KiB
YAML
Raw Normal View History

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