-
Notifications
You must be signed in to change notification settings - Fork 13
/
.gitlab-ci.yml
90 lines (83 loc) · 4.4 KB
/
.gitlab-ci.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
image: registry.ddbuild.io/ubuntu:22.04
stages:
- test
- release
.jobs-resource-allocation:
variables:
# Sized resources using https://app.datadoghq.com/dashboard/xff-wqx-4a2/ci-reliability-kubernetes-runner-sizing-and-diagnotic
KUBERNETES_CPU_REQUEST: "6"
KUBERNETES_CPU_LIMIT: "6"
KUBERNETES_MEMORY_REQUEST: "12Gi"
KUBERNETES_MEMORY_LIMIT: "12Gi"
# Using non-integer CPU requests/limits to avoid the static CPU policy to be set on the helper container.
# Static CPU policy reserves full CPU cores for containers with integer requests. It is used to isolate
# CI job containers from each other and prevent noisy ones to starve resources on a CI node.
# By using non-integer CPU request and limits for the helper container, responsible for cloning,
# we can leverage multi-cores to speed-up git clones while preserving isolation for the build container.
KUBERNETES_HELPER_CPU_REQUEST: "200m"
KUBERNETES_HELPER_CPU_LIMIT: "200m"
KUBERNETES_HELPER_MEMORY_REQUEST: "1Gi"
KUBERNETES_HELPER_MEMORY_LIMIT: "1Gi"
test-and-build-arm64:
extends:
- .jobs-resource-allocation
stage: test
script:
- apt-get update
- apt-get install -y git curl build-essential pkg-config libssl-dev
- curl https://sh.rustup.rs -sSf > rustup.sh && chmod a+x rustup.sh && ./rustup.sh -y && rm -f rustup.sh
- source "$HOME/.cargo/env"
- cargo build -r
- cargo test
- apt-get install -y python3 python3-requests
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l java
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l javascript
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l typescript
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l go
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l ruby
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l csharp
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l python
variables:
DD_SITE: datadoghq.com
tags:
- arch:arm64
test-and-build-amd64:
extends:
- .jobs-resource-allocation
stage: test
script:
- apt-get update
- apt-get install -y git curl build-essential pkg-config libssl-dev
- curl https://sh.rustup.rs -sSf > rustup.sh && chmod a+x rustup.sh && ./rustup.sh -y && rm -f rustup.sh
- source "$HOME/.cargo/env"
- cargo build -r
- cargo test
- apt-get install -y python3 python3-requests
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l java
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l javascript
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l typescript
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l go
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l ruby
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l csharp
- python3 misc/test-rules.py -c $PWD/target/release/datadog-static-analyzer -s $PWD/target/release/datadog-static-analyzer-server -l python
variables:
DD_SITE: datadoghq.com
tags:
- arch:amd64
trigger_internal_image:
stage: release
only:
- main
trigger:
project: DataDog/images
branch: ${DD_IMAGES_BRANCH}
strategy: depend
variables:
DD_IMAGES_BRANCH: master
IMAGE_VERSION: current
IMAGE_NAME: datadog-static-analyzer
RELEASE_TAG: ${CI_COMMIT_SHORT_SHA}
BUILD_TAG: ${CI_COMMIT_SHORT_SHA}
TMPL_SRC_IMAGE: v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}
RELEASE_STAGING: "true"
RELEASE_PROD: "true"