-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
60 lines (56 loc) · 1.6 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
image: registry.gitlab.com/fireblocks/shell/infra/images/node-infra-18:latest
stages:
- check_version
- lint
- test
check_version_change:
stage: check_version
allow_failure: false
tags:
- build-shell
script:
- git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- |
if ! git diff --name-only origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME..$CI_COMMIT_SHA | grep "src/version.ts"; then
echo "Error: version.ts was not modified in this merge request."
exit 1
fi
- |
if ! git diff origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME..$CI_COMMIT_SHA -- src/version.ts | grep -E "export\s+const\s+AGENT_VERSION\s*=\s*"; then
echo "Error: version constant was not modified in version.ts."
exit 1
fi
only:
- merge_requests
format:
stage: lint
allow_failure: false
tags:
- build-shell
script:
- npm install
- npm run format:check
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: always
- if: $CI_COMMIT_BRANCH == "github" || $CI_COMMIT_BRANCH == "main"
when: always
- when: never
test:
image: registry.gitlab.com/fireblocks/shell/infra/images/node-infra-18:latest
stage: test
tags:
- build-shell
allow_failure: false
script:
- npm install
- npm run build
- npm test
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TITLE =~ /^Draft:/
when: manual
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: always
- if: $CI_COMMIT_BRANCH == "github" || $CI_COMMIT_BRANCH == "main"
when: always
- when: never