Skip to content

Commit 640283f

Browse files
committed
Reuse jobs in Circle CI
1 parent c8d50a6 commit 640283f

File tree

4 files changed

+83
-273
lines changed

4 files changed

+83
-273
lines changed

.circleci/config.yml

Lines changed: 80 additions & 270 deletions
Original file line numberDiff line numberDiff line change
@@ -1,291 +1,101 @@
1-
version: 2
2-
jobs:
3-
"gcc":
4-
docker:
5-
- image: ubuntu:18.04
6-
environment:
7-
CXX: g++-7
8-
steps:
9-
- checkout
10-
11-
- run: apt-get update -qq
12-
- run: >
13-
apt-get install -y
14-
build-essential
15-
cmake
16-
g++-7
17-
git
18-
19-
- run:
20-
name: Building (gcc)
21-
command: make
22-
23-
- run:
24-
name: Running tests (gcc)
25-
command: make quiettest amalgamate
26-
27-
- run:
28-
name: Comparing perf against reference (gcc)
29-
command: make checkperf
30-
31-
- run:
32-
name: Building (gcc, cmake, dynamic)
33-
command: |
34-
mkdir build
35-
cd build
36-
cmake -DSIMDJSON_BUILD_STATIC=OFF ..
37-
make
38-
39-
- run:
40-
name: Running tests (gcc, cmake, dynamic)
41-
command: |
42-
cd build
43-
make test
44-
45-
- run:
46-
name: Building (gcc, cmake, static)
47-
command: |
48-
mkdir buildstatic
49-
cd buildstatic
50-
cmake -DSIMDJSON_BUILD_STATIC=ON ..
51-
make
52-
53-
- run:
54-
name: Running tests (gcc, cmake, static)
55-
command: |
56-
cd buildstatic
57-
make test
1+
version: 2.1
582

59-
- run:
60-
name: Building (gcc, cmake, sanitize)
61-
command: |
62-
mkdir buildsani
63-
cd buildsani
64-
cmake -DSIMDJSON_SANITIZE=ON -DSIMDJSON_BUILD_STATIC=OFF ..
65-
make
66-
67-
- run:
68-
name: Running tests (gcc, cmake, sanitize)
69-
command: |
70-
cd buildsani
71-
make test
72-
73-
"gccnoavx":
3+
executors:
4+
gcc7:
745
docker:
75-
- image: ubuntu:18.04
6+
- image: gcc:7
767
environment:
77-
CXX: g++-7
78-
steps:
79-
- checkout
80-
81-
- run: apt-get update -qq
82-
- run: >
83-
apt-get install -y
84-
build-essential
85-
cmake
86-
g++-7
87-
git
88-
89-
- run:
90-
name: Building (gcc)
91-
command: ARCHFLAGS="-march=nehalem" make
92-
93-
- run:
94-
name: Running tests (gcc)
95-
command: ARCHFLAGS="-march=nehalem" make quiettest amalgamate
96-
97-
- run:
98-
name: Comparing perf against reference (gcc)
99-
command: ARCHFLAGS="-march=nehalem" make checkperf
100-
101-
- run:
102-
name: Building (gcc, cmake, dynamic)
103-
command: |
104-
mkdir build
105-
cd build
106-
cmake -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=OFF ..
107-
make
108-
109-
- run:
110-
name: Running tests (gcc, cmake, dynamic)
111-
command: |
112-
cd build
113-
make test
114-
115-
- run:
116-
name: Building (gcc, cmake, static)
117-
command: |
118-
mkdir buildstatic
119-
cd buildstatic
120-
cmake -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=ON ..
121-
make
122-
123-
- run:
124-
name: Running tests (gcc, cmake, static)
125-
command: |
126-
cd buildstatic
127-
make test
128-
129-
- run:
130-
name: Building (gcc, cmake, sanitize)
131-
command: |
132-
mkdir buildsani
133-
cd buildsani
134-
cmake -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_SANITIZE=ON ..
135-
make
136-
137-
- run:
138-
name: Running tests (gcc, cmake, sanitize)
139-
command: |
140-
cd buildsani
141-
make test
142-
"clang":
8+
CXX: g++
9+
clang6:
14310
docker:
14411
- image: ubuntu:18.04
14512
environment:
14613
CXX: clang++-6.0
147-
steps:
148-
- checkout
149-
150-
- run: apt-get update -qq
151-
- run: >
152-
apt-get install -y
153-
build-essential
154-
cmake
155-
clang-6.0
156-
git
157-
158-
- run:
159-
name: Building (clang)
160-
command: make
161-
162-
- run:
163-
name: Running tests (clang)
164-
command: make quiettest amalgamate
165-
166-
- run:
167-
name: Comparing perf against reference (clang)
168-
command: make checkperf
169-
170-
- run:
171-
name: Building (clang, cmake, dynamic)
172-
command: |
173-
mkdir build
174-
cd build
175-
cmake -DSIMDJSON_BUILD_STATIC=OFF ..
176-
make
17714

178-
- run:
179-
name: Running tests (clang, cmake, dynamic)
180-
command: |
181-
cd build
182-
make test
15+
commands:
16+
init_gcc7:
17+
steps:
18+
- run: echo true
19+
init_clang6:
20+
steps:
21+
- run: apt-get install -y clang build-essential git
18322

184-
- run:
185-
name: Building (clang, cmake, static)
186-
command: |
187-
mkdir buildstatic
188-
cd buildstatic
189-
cmake -DSIMDJSON_BUILD_STATIC=ON ..
190-
make
23+
jobs:
19124

192-
- run:
193-
name: Running tests (clang, cmake, static)
194-
command: |
195-
cd buildstatic
196-
make test
25+
# Parameterized job to run all tests with "make"
26+
make_test:
27+
description: Build, run tests and check performance
28+
parameters:
29+
compiler:
30+
description: Compiler
31+
type: string
32+
archflags:
33+
description: Architecture flags (ARCHFLAGS)
34+
default: ""
35+
type: string
19736

198-
- run:
199-
name: Building (clang, cmake, sanitize)
200-
command: |
201-
mkdir buildsani
202-
cd buildsani
203-
cmake -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON ..
204-
make
37+
executor: << parameters.compiler >>
20538

206-
- run:
207-
name: Running tests (clang, cmake, sanitize)
208-
command: |
209-
cd buildsani
210-
make test
39+
environment:
40+
ARCHFLAGS: << parameters.archflags >>
21141

212-
"clangnoavx":
213-
docker:
214-
- image: ubuntu:18.04
215-
environment:
216-
CXX: clang++-6.0
21742
steps:
21843
- checkout
219-
22044
- run: apt-get update -qq
221-
- run: >
222-
apt-get install -y
223-
build-essential
224-
cmake
225-
clang-6.0
226-
git
227-
228-
- run:
229-
name: Building (clang)
230-
command: ARCHFLAGS="-march=nehalem" make
231-
232-
- run:
233-
name: Running tests (clang)
234-
command: ARCHFLAGS="-march=nehalem" make quiettest amalgamate
235-
236-
- run:
237-
name: Comparing perf against reference (clang)
238-
command: ARCHFLAGS="-march=nehalem" make checkperf
239-
240-
- run:
241-
name: Building (clang, cmake, dynamic)
242-
command: |
243-
mkdir build
244-
cd build
245-
cmake -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_DISABLE_AVX=on ..
246-
make
247-
248-
- run:
249-
name: Running tests (clang, cmake, dynamic)
250-
command: |
251-
cd build
252-
make test
253-
254-
255-
- run:
256-
name: Building (clang, cmake, static)
257-
command: |
258-
mkdir buildstatic
259-
cd buildstatic
260-
cmake -DSIMDJSON_BUILD_STATIC=ON -DSIMDJSON_DISABLE_AVX=on ..
261-
make
45+
- init_<< parameters.compiler >>
46+
- run: make
47+
- run: make amalgamate
48+
- run: make test
49+
- run: make checkperf
50+
51+
# Parameterized job to run all tests with "cmake"
52+
cmake_test:
53+
description: Build, run tests and check performance
54+
55+
parameters:
56+
compiler:
57+
description: Compiler
58+
type: string
59+
flags:
60+
description: flags to pass to cmake
61+
default: ""
62+
type: string
63+
64+
executor: << parameters.compiler >>
26265

263-
- run:
264-
name: Running tests (clang, cmake, static)
265-
command: |
266-
cd buildstatic
267-
make test
268-
269-
270-
- run:
271-
name: Building (clang, cmake, sanitize)
272-
command: |
273-
mkdir buildsani
274-
cd buildsani
275-
cmake -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_SANITIZE=ON ..
276-
make
277-
278-
- run:
279-
name: Running tests (clang, cmake, sanitize)
280-
command: |
281-
cd buildsani
282-
make test
66+
steps:
67+
- run: apt-get update -qq
68+
- init_<< parameters.compiler >>
69+
- run: apt-get install -y cmake
70+
- checkout
71+
- run: cmake << parameters.flags >>
72+
- run: make
73+
- run: make test
28374

28475
workflows:
285-
version: 2
76+
version: 2.1
28677
build_and_test:
28778
jobs:
288-
- "clang"
289-
- "gcc"
290-
- "clangnoavx"
291-
- "gccnoavx"
79+
# gcc7
80+
- make_test: { compiler: gcc7 }
81+
- cmake_test: { compiler: gcc7, flags: -DSIMDJSON_BUILD_STATIC=ON }
82+
- cmake_test: { compiler: gcc7, flags: -DSIMDJSON_BUILD_STATIC=ON }
83+
- cmake_test: { compiler: gcc7, flags: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON }
84+
# gcc7 - no AVX
85+
- make_test: { compiler: gcc7, archflags: -march=nehalem }
86+
- cmake_test: { compiler: gcc7, flags: -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=ON }
87+
- cmake_test: { compiler: gcc7, flags: -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=ON }
88+
- cmake_test: { compiler: gcc7, flags: -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON }
89+
# clang6
90+
- make_test: { compiler: clang6 }
91+
- cmake_test: { compiler: clang6, flags: -DSIMDJSON_BUILD_STATIC=ON }
92+
- cmake_test: { compiler: clang6, flags: -DSIMDJSON_BUILD_STATIC=ON }
93+
- cmake_test: { compiler: clang6, flags: -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON }
94+
# clang6 - no AVX
95+
- make_test: { compiler: clang6, archflags: -march=nehalem }
96+
- cmake_test: { compiler: clang6, flags: -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=ON }
97+
- cmake_test: { compiler: clang6, flags: -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=ON }
98+
- cmake_test: { compiler: clang6, flags: -DSIMDJSON_DISABLE_AVX=ON -DSIMDJSON_BUILD_STATIC=OFF -DSIMDJSON_SANITIZE=ON }
99+
100+
# TODO add windows: https://circleci.com/docs/2.0/configuration-reference/#windows
101+

singleheader/amalgamation_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Wed Aug 14 10:31:26 DST 2019. Do not edit! */
1+
/* auto-generated on Wed Aug 14 13:56:54 DST 2019. Do not edit! */
22

33
#include <iostream>
44
#include "simdjson.h"

singleheader/simdjson.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Wed Aug 14 10:31:26 DST 2019. Do not edit! */
1+
/* auto-generated on Wed Aug 14 13:56:54 DST 2019. Do not edit! */
22
#include "simdjson.h"
33

44
/* used for http://dmalloc.com/ Dmalloc - Debug Malloc Library */

singleheader/simdjson.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Wed Aug 14 10:31:26 DST 2019. Do not edit! */
1+
/* auto-generated on Wed Aug 14 13:56:54 DST 2019. Do not edit! */
22
/* begin file include/simdjson/simdjson_version.h */
33
// /include/simdjson/simdjson_version.h automatically generated by release.py,
44
// do not change by hand

0 commit comments

Comments
 (0)