-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
137 lines (125 loc) · 3.16 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
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
image: ${REGISTRY}/it/docker:19.03.1
services:
- name: ${REGISTRY}/it/docker:20.10.21-dind
alias: docker
variables:
GIT_STRATEGY: "clone"
include:
- template: Security/Dependency-Scanning.gitlab-ci.yml
stages:
- compile
- test
- publish
- scan
.create-environment: &create-environment
image: ${REGISTRY}/it/hseeberger/scala-sbt:11.0.14.1_1.6.2_2.12.15
tags:
- wavesenterprise
before_script:
- cat "$SBT_CREDENTIALS" > /root/.sbt/.credentials
### Scan job
trivy_scan:
stage: scan
script:
- docker run -v "$(pwd):/repo/" bitnami/trivy repo /repo/
### Compile jobs
compile:
<<: *create-environment
stage: compile
script:
- sbt 'version; scalafmtCheckAll; compile; Test / compile'
artifacts:
paths:
- "target"
- "project/target"
- "project/project/target"
- "*/target"
- "*/project/target"
- "*/project/project/target"
- "*/*/target"
- "*/*/project/target"
- "*/*/project/project/target"
expire_in: 3 day
### Testing jobs
test-core:
<<: *create-environment
stage: test
script:
- sbt -mem 2048 "testOnly -- -l \"com.wavesenterprise.utils.TypescriptTestWithDocker\""
cache: [ ]
artifacts:
reports:
junit:
- target/test-reports/*.xml
- lang/jvm/target/test-reports/*.xml
dependencies:
- compile
test-typescript-generated-transactions:
<<: *create-environment
stage: test
script:
- sbt "compile; Test / compile"
- cd transactions-factory
- apt-get update -y
- curl -sL https://deb.nodesource.com/setup_18.x | bash
- apt-get install nodejs -yq
- npm install
# - npm test TODO: WE-8895 after Test.ts fixed
- cd ..
- sbt -mem 2048 "testOnly *TypeScriptTransactionsBytesSuite"
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
NODE_HOST: docker
cache: [ ]
artifacts:
reports:
junit:
- target/test-reports/*.xml
- lang/jvm/target/test-reports/*.xml
dependencies:
- compile
dependency_scanning:
stage: test
artifacts:
reports:
dependency_scanning: gl-dependency-scanning-report.json
publish-nexus-artifacts:
<<: *create-environment
stage: publish
needs:
- compile
- test-core
- test-typescript-generated-transactions
script:
- cat "$SBT_CREDENTIALS_SONATYPE" > /root/.sbt/.sonatype-credentials
- echo $PGP_KEY | base64 --decode > pgp.key && gpg --batch --import pgp.key
- sbt -mem 2048 core/publishSigned
cache: [ ]
only:
- tags
- branches
dependencies:
- compile
publish-typescript-transactions-factory:
<<: *create-environment
stage: publish
needs:
- compile
- test-core
- test-typescript-generated-transactions
before_script:
- apt-get update && apt-get install git -y
script:
- cd transactions-factory
- curl -sL https://deb.nodesource.com/setup_18.x | bash
- apt-get install nodejs -yq
- npm install
- git config --global user.email support@wavesenterprise.com;
- git config --global user.name wavesenterprise;
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
- npm publish
only:
- /^v[0-9].*$/
tags:
- wavesenterprise