summaryrefslogtreecommitdiff
path: root/.gitlab/test.yml
blob: 1940d576cbb2b1563320931daee86ab6629e8f20 (plain)
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
size:
  image: docker:stable
  stage: test
  services:
    - docker:stable-dind
  tags: [gitlab-org-docker]
  timeout: 3 minutes
  variables:
    GIT_STRATEGY: none
    MAX_SIZE: 1567663064
  script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
    - docker pull $TMP_IMAGE
    - docker image ls $TMP_IMAGE
    - export CURRENT_SIZE=$(docker image inspect $TMP_IMAGE --format='{{.Size}}')
    - echo $MAX_SIZE
    - echo $CURRENT_SIZE
    - test "$MAX_SIZE" -gt "$CURRENT_SIZE"
  needs: ['build-docker-image']
  dependencies: []

lint:
  stage: test
  image: ruby:alpine
  script:
    - apk add bash build-base git shellcheck
    - bin/setup
    - bin/lint
  needs: []
  dependencies: []

.rspec:
  stage: test
  script:
    - ./bin/setup
    - ./bin/test $RSPEC_DIR --format RspecJunitFormatter --out rspec.xml
  variables:
    GIT_DEPTH: "10"
    GIT_STRATEGY: fetch
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - vendor
  artifacts:
    expire_in: 1 week
    paths:
      - coverage/coverage.xml
      - rspec.xml
    expire_in: 1 week
    reports:
      cobertura: coverage/coverage.xml
      junit: rspec.xml
  needs: ['build-docker-image']
  dependencies: []

unit:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/unit

integration-c:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/c
  needs:
    - build-docker-image
    - build-conan-pkg

integration-dotnet:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/dotnet
  needs: ['build-docker-image']

integration-go:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/go
  needs: ['build-docker-image']

integration-java-gradle:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/java/gradle_spec.rb
  needs:
    - build-docker-image

integration-java-maven:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/java/maven_spec.rb
  needs:
    - build-docker-image
    - build-mvn-pkg

integration-js:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/js
  needs: ['build-docker-image']

integration-php:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/php
  needs: ['build-docker-image']

integration-python:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/python
  needs: ['build-docker-image']

integration-ruby:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/ruby
  needs: ['build-docker-image']

integration-rust:
  extends: .rspec
  variables:
    RSPEC_DIR: spec/integration/rust
  needs: ['build-docker-image']

.functional:
  stage: test
  trigger: gitlab-org/security-products/tests/common
  variables:
    CONTAINER_SCANNING_DISABLED: 'true'
    DAST_DISABLED: 'true'
    DEPENDENCY_SCANNING_DISABLED: 'true'
    DS_DEFAULT_ANALYZERS: ''
    LICENSE_MANAGEMENT_VERSION: $CI_COMMIT_SHA
    SAST_DEFAULT_ANALYZERS: ''
    SAST_DISABLED: 'true'
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
      when: always
      allow_failure: true

functional-c-conan:
  extends: .functional
  trigger: gitlab-org/security-products/tests/c-conan

functional-csharp-nuget-dotnetcore:
  extends: .functional
  trigger: gitlab-org/security-products/tests/csharp-nuget-dotnetcore

functional-go-modules:
  extends: .functional
  trigger: gitlab-org/security-products/tests/go-modules

functional-java-gradle:
  extends: .functional
  trigger: gitlab-org/security-products/tests/java-gradle

functional-java-maven-multimodules:
  extends: .functional
  trigger: gitlab-org/security-products/tests/java-maven-multimodules

functional-java-maven:
  extends: .functional
  trigger: gitlab-org/security-products/tests/java-maven

functional-js-bower:
  extends: .functional
  trigger: gitlab-org/security-products/tests/js-bower

functional-js-npm:
  extends: .functional
  trigger: gitlab-org/security-products/tests/js-npm

functional-js-yarn:
  extends: .functional
  trigger: gitlab-org/security-products/tests/js-yarn

functional-ruby-bundler_js-yarn:
  extends: .functional
  trigger: gitlab-org/security-products/tests/ruby-bundler_js-yarn

functional-php-composer:
  extends: .functional
  trigger: gitlab-org/security-products/tests/php-composer

functional-python-pip:
  extends: .functional
  trigger: gitlab-org/security-products/tests/python-pip

functional-ruby-bundler:
  extends: .functional
  trigger: gitlab-org/security-products/tests/ruby-bundler

functional-rust-cargo:
  extends: .functional
  trigger: gitlab-org/security-products/tests/rust-cargo