forked from cyclus/cyclus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
circle.yml
179 lines (170 loc) · 6.53 KB
/
circle.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
version: 2
jobs:
# Update docker container
deploy_latest: # Cyclus/dev -> Cyclus:latest
docker:
- image: circleci/ruby:2.4-node
working_directory: ~/cyclus
steps:
# Ensure your image has git (required by git to clone via SSH) so that CircleCI can clone your repo
- checkout
- run:
name: Place the proper Dockerfile
command: cp docker/cyclus-ci/Dockerfile .
- setup_remote_docker
- run:
name: log into Docker
command: |
docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: Build Docker container
command: docker build --rm=false -t cyclus/cyclus:latest .
- run:
name: Push on DockerHub
command: docker push cyclus/cyclus:latest # push to docker depot
deploy_stable:
docker: # Cyclus/master -> Cyclus:stable
- image: circleci/ruby:2.4-node
working_directory: ~/cyclus
steps:
- checkout
- run:
name: Place the proper Dockerfile
command: cp docker/cyclus-ci/Dockerfile .
- setup_remote_docker
- run:
name: Log on DockerHub
command: |
docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: Tag and Push on DockerHub
command: |
docker tag cyclus/cyclus:latest cyclus/cyclus:stable # creation
docker push cyclus/cyclus:stable # push to docker depot
# Debian package generation (on master update)
deb_generation:
docker:
- image: circleci/ruby:2.4-node
working_directory: ~/cyclus
steps:
- checkout
- setup_remote_docker
- run:
name: Tag and Push on DockerHub
command: |
docker/deb-ci/build_upload_deb.sh 14
docker/deb-ci/build_upload_deb.sh 16
# Checking Cycamore and Cymetric compatibilities with the changes
cycamore_master: ## Cycamore/master against Cyclus/dev
docker:
- image: cyclus/cyclus-deps
working_directory: /root
steps:
# Ensure your image has git (required by git to clone via SSH) so that CircleCI can clone your repo
- run: apt-get -qq update; apt-get -y install git openssh-client
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
keys:
- v1-repo-{{ checksum ".circle-sha" }}
- run:
name: Checkout Cycamore Master
command: |
git clone https://github.com/cyclus/cycamore.git
cd cycamore
git fetch --all
git checkout master
- run:
name: Build Cycamore
command: |
cd cycamore
python install.py -j 2 --build-type=Release \
-DBLAS_LIBRARIES="/opt/conda/lib/libblas.so" \
-DLAPACK_LIBRARIES="/opt/conda/lib/liblapack.so"
- run:
name: Unit Test
command: /root/.local/bin/cycamore_unit_tests; exit $?
- run:
name: Nosetests
command: nosetests -w ~/cycamore/tests; exit $?
cymetric_master: ## Cymetric/master against Cyclus/dev + Cycamore/dev
docker:
- image: cyclus/cyclus-deps
working_directory: /root
steps:
# Ensure your image has git (required by git to clone via SSH) so that CircleCI can clone your repo
- run: apt-get -qq update; apt-get -y install git openssh-client
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
keys:
- v1-repo-{{ checksum ".circle-sha" }}
- run:
name: Checkout Cycamore Master
command: |
git clone https://github.com/cyclus/cycamore.git
cd cycamore
git fetch --all
git checkout master
- run:
name: Build Cycamore
command: |
cd cycamore
python install.py -j 2 --build-type=Release \
-DBLAS_LIBRARIES="/opt/conda/lib/libblas.so" \
-DLAPACK_LIBRARIES="/opt/conda/lib/liblapack.so"
- run: cd ~/
- run:
name: Checkout Cymetric Master
command: |
git clone https://github.com/cyclus/cymetric.git
cd cymetric
git fetch --all
git checkout master
- run:
name: Build/Install Cymetric
command: |
cd cymetric
python setup.py install
- run:
name: Cymetric Nosetest
command: nosetests -w ~/cymetric/tests; exit $?
# some external triggers
cyXX_trig:
machine: true
steps:
- run:
name: Cymetric/Cycamore Master Triggers
command: |
curl -X POST https://circleci.com/api/v1.1/project/github/cyclus/cycamore/tree/master?circle-token=$CYCAMORE_CIRCLE_TOKEN
curl -X POST https://circleci.com/api/v1.1/project/github/cyclus/cymetric/tree/master?circle-token=$CYMETRIC_CIRCLE_TOKEN
workflows:
version: 2 #Needed ?? (already on the top of the file)
build_and_test:
jobs:
# Merge on Master
- deploy_latest:
filters:
branches:
only: master
- cyXX_trig:
filters:
branches:
only: master
requires:
- deploy_latest
# The following should now be done on version tag.
- deploy_stable:
filters:
branches:
ignore: /.*/
tags:
only: /.*/
- deb_generation:
filters:
branches:
ignore: /.*/
tags:
only: /.*/