Skip to content

Commit 27be20f

Browse files
committed
GitLab CI Improvements
- Git Depth 10 by default - Fetch all history only for sonarcloud job - Use alpine image for pages job and no cache
1 parent 509b7fe commit 27be20f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.gitlab-ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
image: python:3.6
1+
image: python:3.8
22

33
variables:
44
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
55
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
6-
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
6+
GIT_DEPTH: 10
77
DOCKER_DRIVER: overlay2
88

99
before_script:
@@ -40,10 +40,11 @@ sonarcloud-check:
4040
stage: analyze
4141
image:
4242
name: sonarsource/sonar-scanner-cli:latest
43-
entrypoint: [""]
43+
entrypoint: [ "" ]
44+
before_script:
45+
- git fetch --unshallow origin +refs/heads/*:refs/remotes/origin/*
4446
script:
4547
- sonar-scanner
46-
before_script: []
4748
dependencies:
4849
- coverage
4950
only:
@@ -76,6 +77,8 @@ coverage:
7677

7778
pages:
7879
stage: deploy
80+
image: alpine
81+
cache: { }
7982
dependencies:
8083
- docs
8184
- coverage

0 commit comments

Comments
 (0)