-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
110 lines (98 loc) · 2.8 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
110 lines (98 loc) · 2.8 KB
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
default:
image: node:20
.yarn_cache_template: &yarn_cache_template
key:
files:
- package.json
- yarn.lock
paths:
- .cache_exists
- .yarn-cache/
- node_modules/
- circuits/node_modules/
- contracts/node_modules/
- crypto/node_modules/
- subgraph/node_modules/
policy: pull
.base_scripts: &base_scripts
- time yarn danger ci
- echo "${CI_COMMIT_MESSAGE}" | yarn commitlint
- time yarn lint
- time yarn build:types
- time yarn test:ci
.build_then_deploy_staging_internal: &build_then_deploy_staging_internal
- echo "No dapp present; skipping dapp staging build and deploy"
.build_then_deploy_canary_public: &build_then_deploy_canary_public
- echo "No dapp present; skipping canary build and deploy"
.combined_job_template:
cache:
<<: *yarn_cache_template
policy: pull
before_script:
- time yarn install --frozen-lockfile --check-files --cache-folder .yarn-cache
.ipfs_deploy_script: &ipfs_deploy_script
- echo "No dapp present; skipping IPFS deploy"
job-on-MR:
extends: .combined_job_template
rules:
- if: $CI_COMMIT_TITLE !~ /^Merge branch/ && $CI_PIPELINE_SOURCE == "merge_request_event"
when: always
interruptible: true
script:
- *base_scripts
- *build_then_deploy_staging_internal
- *build_then_deploy_canary_public
timeout: 30m
.ipfs_unpin_script: &ipfs_unpin_script
- echo "No dapp present; skipping IPFS unpin"
job-on-merge:
extends: .combined_job_template
rules:
- if: $CI_COMMIT_TITLE =~ /^Merge branch/
when: always
script:
- *base_scripts
- *ipfs_unpin_script
timeout: 30m
build-cache:
interruptible: true
rules:
- if: $CI_COMMIT_TITLE !~ /^Merge branch/ && $CI_PIPELINE_SOURCE == "merge_request_event"
when: always
cache:
<<: *yarn_cache_template
policy: pull-push
script:
- |
if [[ -d node_modules ]]; then
echo "Cache already exists"
exit 10
fi
- time yarn install --frozen-lockfile --check-files --cache-folder .yarn-cache
allow_failure:
exit_codes: 10
timeout: 30m
circom-test:
image: node:18-bullseye
stage: test
rules:
- if: $CI_COMMIT_TITLE !~ /^Merge branch/ && $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- circuits/**/*
before_script:
- apt-get update && apt-get install -y curl git build-essential
- npm install -g typescript
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- source ~/.profile
- cargo --version
- git clone --branch v2.1.9 https://github.com/iden3/circom.git
- cd circom && cargo build --release
- cargo install --path circom
- circom --version
script:
- cd .. && cd crypto/ && yarn && yarn build
- cd ../circuits/test
- rm -rf lib/*
- yarn && yarn install
- yarn test
timeout: 30m