forked from SonarSource/rspec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
122 lines (110 loc) · 3.56 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
gcp_credentials: ENCRYPTED[!17c59813193e86cc337bce848b358412b90f50bc5fe1b8b39d363cdf14a41ebe76cfba0482e7f81d076994b9f6dbfb4c!]
env:
GITHUB_TOKEN: ENCRYPTED[!f458126aa9ed2ac526f220c5acb51dd9cc255726b34761a56fc78d4294c11089502a882888cef0ca7dd4085e72e611a5!]
SONAR_HOST_URL: https://next.sonarqube.com/sonarqube
SONAR_TOKEN: ENCRYPTED[!b6fd814826c51e64ee61b0b6f3ae621551f6413383f7170f73580e2e141ac78c4b134b506f6288c74faa0dd564c05a29!]
SONAR_SCANNER_VERSION: 4.6.1.2450
SONAR_SCANNER_HOME: ${HOME}/.sonar/sonar-scanner-${SONAR_SCANNER_VERSION}-linux
PATH: ${SONAR_SCANNER_HOME}/bin:$PATH
# Need to clone full depth to track the changed files: for SQ analysis and for validation tasks
CIRRUS_CLONE_DEPTH: 0
# Use bash (instead of sh on linux or cmd.exe on windows)
CIRRUS_SHELL: bash
container_definition: &CONTAINER_DEFINITION
builder_image_project: language-team
builder_image_name: docker-builder-lt-v1
cluster_name: cirrus-ci-lt-cluster
zone: us-central1-a
namespace: default
use_in_memory_disk: true
setup_sonar_scanner: &SETUP_SONAR_SCANNER
setup_sonar_scanner_script:
- apt update -y && apt upgrade -y && apt update -y && apt install -y unzip
- curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
tooling_tests_task:
gke_container:
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
cpu: 1
memory: 2G
env:
PYTHONPATH: .
install_dependencies_script:
- cd rspec-tools
- pipenv install
- pipenv run pip install pytest pytest-cov
tests_script:
- cd rspec-tools
- pipenv run pytest --cov=rspec_tools --cov-report=xml
<<: *SETUP_SONAR_SCANNER
analyze_script:
- cd rspec-tools
- sonar-scanner
frontend_tests_task:
gke_container:
<<: *CONTAINER_DEFINITION
dockerfile: ci/frontend-tests-dockerfile
cpu: 1
memory: 2G
node_modules_cache:
folder: frontend/node_modules
reupload_on_changes: false # since there is a fingerprint script
fingerprint_script:
- echo $CIRRUS_OS
- node --version
- cat frontend/package-lock.json
populate_script:
- cd frontend
- npm install
tests_script:
- cd frontend
- npm run build
- npm test -- --detectOpenHandles --coverage .
<<: *SETUP_SONAR_SCANNER
analyze_script:
- cd frontend
- sonar-scanner
validate_metadata_task:
gke_container:
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
cpu: 1
memory: 2G
metadata_tests_script:
- ./ci/validate_metadata.sh
validate_asciidoc_task:
gke_container:
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
cpu: 1
memory: 2G
asciidoc_tests_script:
- ./ci/validate_asciidoc.sh
validate_links_task:
timeout_in: 120m
gke_container:
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
cpu: 1
memory: 2G
env:
LINK_CACHE_NAME: link-probing-status
LINK_CACHE_PATH: /root/link-probing-history.cache
tests_script:
- bash ci/cirrus-cache.sh download ${LINK_CACHE_NAME} ${LINK_CACHE_PATH}
- ./ci/validate_links.sh ${LINK_CACHE_PATH}
- bash ci/cirrus-cache.sh upload ${LINK_CACHE_NAME} ${LINK_CACHE_PATH}
all_required_checks_task:
depends_on:
- tooling_tests
- frontend_tests
- validate_metadata
- validate_asciidoc
gke_container:
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
cpu: 1
memory: 1G
print_message_script:
- echo 'All required checks have passed'