This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathconfig.yml
138 lines (135 loc) · 3.8 KB
/
config.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
version: 2.1
orbs:
gcp-cli: circleci/[email protected]
executors:
docker-node:
docker:
- image: circleci/node:11
jobs:
lint_js:
executor: docker-node
steps:
- checkout
- run:
name: Lint JS
command: |
cd implementation/
npm install
npm run js:lint
lint_solidity:
executor: docker-node
steps:
- checkout
- run:
name: Lint Solidity
working_directory: ~/project/implementation
command: |
set -ex
npm install
npm run setup
npm run sol:lint
test_solidity:
executor: docker-node
steps:
- checkout
- run: sudo npm install -g [email protected]
- run:
name: Running testrpc
command: ganache-cli
background: true
- run:
name: Run NPM tests
working_directory: ~/project/implementation/contracts
command: npm install && npm run setup && npm run test
generate_pngs:
docker:
- image: keepnetwork/texlive:15
steps:
- checkout
- run:
name: Generate TeX-based PNGs
working_directory: ~/project/docs
command: |
mkdir -p /tmp/docs/img
make pngs
cp -r img/generated /tmp/docs/img/generated
- persist_to_workspace:
root: /tmp/docs
paths:
- ./img/generated/*.png
generate_docs_tex:
docker:
- image: keepnetwork/texlive:15
steps:
- checkout
- run:
name: Generate TeX Document Files
working_directory: ~/project/docs
command: |
mkdir -p /tmp/docs
make build.pdf
cp *.pdf /tmp/docs
- persist_to_workspace:
root: /tmp/docs
paths:
- ./*.pdf
generate_docs_asciidoctor:
docker:
- image: asciidoctor/docker-asciidoctor
steps:
- checkout
- attach_workspace:
at: ./docs
- run:
name: Generate Asciidoctor PDF/HTML Files
working_directory: ~/project/docs
command: |
set -ex
shopt -s extglob globstar nullglob
asciidoctor -a revdate=`date +%Y-%m-%d` --failure-level=ERROR *.adoc **/*.adoc
for a in $(ls *.html **/*.html); do set +x; mkdir -p /tmp/docs/$(dirname $a); cp $a /tmp/docs/$(dirname $a)/; done
set -x
asciidoctor-pdf -a revdate=`date +%Y-%m-%d` *.adoc **/*.adoc
for a in $(ls *.pdf **/*.pdf); do set +x; mkdir -p /tmp/docs/$(dirname $a); cp $a /tmp/docs/$(dirname $a)/; done
- persist_to_workspace:
root: /tmp/docs
paths:
- ./
upload_docs:
docker:
- image: google/cloud-sdk:slim
steps:
- attach_workspace:
at: /tmp/docs
- gcp-cli/initialize:
google-project-id: GOOGLE_PROJECT_ID
google-compute-zone: GOOGLE_COMPUTE_ZONE_A
# This param doesn't actually set anything, leaving here as a reminder to check when they fix it.
gcloud-service-key: GCLOUD_SERVICE_KEY_DOC_UPLOAD
- run:
name: Upload Document Files to docs.keep.network
command: |
cd /tmp/docs
export DIR=$(test $CIRCLE_BRANCH != master && echo $CIRCLE_BRANCH/)
gsutil -m cp -r * gs://docs.keep.network/tbtc/$DIR
workflows:
version: 2
lint:
jobs:
- lint_js
- lint_solidity
solidity:
jobs:
- test_solidity
docs:
jobs:
- generate_pngs
- generate_docs_tex
- generate_docs_asciidoctor:
requires:
- generate_pngs
- upload_docs:
context: keep-docs
requires:
- generate_docs_tex
- generate_docs_asciidoctor