-
Notifications
You must be signed in to change notification settings - Fork 6
/
circle.yml
166 lines (150 loc) · 5 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
version: 2
jobs:
# Build Cyclus
build:
docker:
- image: cyclus/cyclus:latest
working_directory: ~/recycle
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
- checkout
- run:
name: Build Recycle
command: |
python install.py -j 2 --build-type=Release \
-DBLAS_LIBRARIES="/opt/conda/lib/libblas.so" \
-DLAPACK_LIBRARIES="/opt/conda/lib/liblapack.so"
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- save_cache:
key: v1-repo-{{ checksum ".circle-sha" }}
paths:
- /root
# Test
unit_test:
docker:
- image: cyclus/cyclus:latest
working_directory: ~/root
steps:
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
keys:
- v1-repo-{{ checksum ".circle-sha" }}
- run:
name: Unit Test
command: /root/.local/bin/recycle_unit_tests; exit $?
nosetest:
docker:
- image: cyclus/cyclus:latest
working_directory: ~/root
steps:
- run:
name: save SHA to a file
command: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
keys:
- v1-repo-{{ checksum ".circle-sha" }}
- run:
name: Install nosetest
command: pip install nose
- run:
name: Nosetests
command: nosetests -w ~/recycle/tests; exit $?
# Update docker container
deploy: # Cyclus -> Cyclus:latest
docker:
- image: circleci/ruby:2.4-node
working_directory: ~/recycle
steps:
- checkout
- run:
name: Place the proper Dockerfile
command: cp docker/master-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/recycle:latest .
- run:
name: Push on DockerHub
command: docker push cyclus/recycle:latest # push to docker depot
deploy_stable: # Recycle:stable
docker:
- image: circleci/ruby:2.4-node
working_directory: ~/recycle
steps:
- checkout
- run:
name: Place the proper Dockerfile
command: cp docker/release-ci/Dockerfile .
- setup_remote_docker
- run:
name: Log on DockerHub
command: |
docker login -u $DOCKER_USER -p $DOCKER_PASS
- run:
name: Build Docker container
command: docker build -t cyclus/recycle:stable .
- run:
name: Push on DockerHub
command: docker push cyclus/recycle:stable # push to docker depot
# Debian package generation (on master update)
deb_generation:
docker:
- image: circleci/ruby:2.4-node
working_directory: ~/recycle
steps:
- checkout
- setup_remote_docker
- run:
name: Tag and Push on DockerHub
no_output_timeout: "20m"
command: |
docker/deb-ci/build_upload_deb.sh 14
docker/deb-ci/build_upload_deb.sh 16
workflows:
version: 2
build_and_test:
jobs:
# on a pr // all branch
- build
- unit_test:
requires:
- build
- nosetest:
requires:
- build
# Merge on Master
- deploy:
filters:
branches:
only: master
requires:
- unit_test
- nosetest
# The following should now be done on version tag.
- deploy_stable:
filters:
branches:
ignore: /.*/
tags:
only: /.*/
requires:
- unit_test
- nosetest
- deb_generation:
filters:
branches:
ignore: /.*/
tags:
only: /.*/
requires:
- unit_test
- nosetest