-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.gitlab-ci-template.yml
143 lines (131 loc) · 3.89 KB
/
.gitlab-ci-template.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#################################################################################
##### Gitlab CI Variables
#################################################################################
.retry:
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
.only:
only:
refs:
- master
- main
- /^release-.*$/
.except:
except: [ ]
#################################################################################
##### Gitlab CI Job Implementations
#################################################################################
.build_unit_tests:
extends:
- .retry
image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14
cache:
key: ${CI_JOB_NAME}
paths:
- .m2/
script:
- npm ci
- npm run all
.contract_tests:
extends:
- .retry
image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14
cache:
key: ${CI_JOB_NAME}
paths:
- .m2/
script:
- npm ci
- npm run contract-test
.code_coverage:
image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14
script:
- npm ci
- npm test -- --coverage --collectCoverageFrom='src/**/*.{ts,jxs}'
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
.pop_blackduck_analysis:
image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14
extends:
- .pop_blackduck
- .retry
before_script:
- |
apt-get update -y
apt-get install -y rsync make jq
.new_pop_blackduck_analysis:
image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14
extends:
- .new_pop_blackduck
- .retry
before_script:
- |
apt-get update -y
apt-get install -y rsync make jq python3 python3-pip
pip3 install blackduck requests
export RELEASE_VERSION=`git describe --tags --abbrev=0 2>/dev/null || echo ''`
.version:
extends:
- .only
image: gcr.io/snps-polaris-ops-prod/git-semver:1.2.22
cache: {}
before_script:
- |-
if [[ $(git rev-parse --is-shallow-repository) = "true" ]]; then
echo "Shallow repo, fetching with --unshallow"
git fetch --unshallow
else
echo "Not a shallow repo, nothing to do."
fi
script:
- |-
if [[ "$CI_COMMIT_REF_NAME" != "master" && "$CI_COMMIT_REF_NAME" != "main" ]]; then
if [[ ! -v VERSION_OVERRIDE ]]; then
echo "Versioning not supported on non-master branches without an override present"
exit 1
fi
fi
# if [[ ! -v VERSION_OVERRIDE ]]; then
git-semver get version > version.txt
# git-semver ci tag-commit
# else
echo "Using override version ${VERSION_OVERRIDE}"
# if git rev-parse "$VERSION_OVERRIDE" >/dev/null 2>&1; then
# echo "Version already exists, overwriting version is not supported."
# exit 1
# else
echo $VERSION_OVERRIDE > version.txt
# git-semver ci tag-commit $VERSION_OVERRIDE
# fi
#fi
- VERSION=`cat version.txt`
- echo "Version ${VERSION}"
# - npm version VERSION
artifacts:
paths:
- version.txt
#.changelog:
# image: node:17-buster-slim
# extends:
# - .only
# before_script:
# - apt-get update && apt-get install -y --no-install-recommends git-core ca-certificates
# - npm install -g semantic-release @semantic-release/gitlab @semantic-release/changelog conventional-changelog-conventionalcommits @semantic-release/commit-analyzer @semantic-release/git
# script:
# - semantic-release -r https://sig-gitlab.internal.synopsys.com/integrations/synopsys-action
#
#.check_dist:
# image: gcr.io/snps-polaris-ops-prod/ember_cli:3.28.5-node_16.14
# before_script:
# - npm ci
# - npm run build
# - npm run package
# script:
# - |-
# if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
# echo "Detected uncommitted changes after build. See status below:"
# git diff
# exit 1
# fi