Skip to content

Commit 0c4cf03

Browse files
committed
[CircleCI] Add circle ci 2.0 support
1 parent ee6b59d commit 0c4cf03

3 files changed

Lines changed: 196 additions & 1 deletion

File tree

.circleci/config.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
version: 2.1
2+
3+
jobs:
4+
5+
checkout-code:
6+
docker:
7+
- image: debian:stretch
8+
steps:
9+
- checkout
10+
- save_cache:
11+
key: repo-{{ .Environment.CIRCLE_SHA1 }}
12+
paths:
13+
- ~/project
14+
15+
cppcheck:
16+
docker:
17+
- image: debian:stretch
18+
steps:
19+
- restore_cache:
20+
key: repo-{{ .Environment.CIRCLE_SHA1 }}
21+
- run:
22+
name: Greeting
23+
command: echo Hello, world.
24+
- run:
25+
name: Print the Current Time
26+
command: date
27+
28+
shellcheck:
29+
docker:
30+
- image: koalaman/shellcheck-alpine:stable
31+
steps:
32+
- checkout
33+
- run:
34+
name: Check Shell Scripts
35+
command: find . -type f -name "*.sh" -exec shellcheck -e SC2010 -e SC2016 {} \+
36+
37+
cmake-format:
38+
docker:
39+
- image: debian:stretch
40+
steps:
41+
- checkout
42+
- run:
43+
name: Greeting
44+
command: echo Hello, world.
45+
- run:
46+
name: Print the Current Time
47+
command: date
48+
49+
clang-tidy:
50+
docker:
51+
- image: debian:stretch
52+
steps:
53+
- checkout
54+
- run:
55+
name: Greeting
56+
command: echo Hello, world.
57+
- run:
58+
name: Print the Current Time
59+
command: date
60+
61+
build-gcc-7:
62+
docker:
63+
- image: debian:stretch
64+
steps:
65+
- checkout
66+
- run:
67+
name: Greeting
68+
command: echo Hello, world.
69+
- run:
70+
name: Print the Current Time
71+
command: date
72+
73+
build-gcc-8:
74+
docker:
75+
- image: debian:stretch
76+
steps:
77+
- checkout
78+
- run:
79+
name: Greeting
80+
command: echo Hello, world.
81+
- run:
82+
name: Print the Current Time
83+
command: date
84+
85+
build-clang-7:
86+
docker:
87+
- image: debian:stretch
88+
steps:
89+
- checkout
90+
- run:
91+
name: Greeting
92+
command: echo Hello, world.
93+
- run:
94+
name: Print the Current Time
95+
command: date
96+
97+
unit-test:
98+
docker:
99+
- image: debian:stretch
100+
steps:
101+
- checkout
102+
- run:
103+
name: Greeting
104+
command: echo Hello, world.
105+
- run:
106+
name: Print the Current Time
107+
command: date
108+
109+
integration-test:
110+
docker:
111+
- image: debian:stretch
112+
steps:
113+
- checkout
114+
- run:
115+
name: Greeting
116+
command: echo Hello, world.
117+
- run:
118+
name: Print the Current Time
119+
command: date
120+
121+
unit-test-asan:
122+
docker:
123+
- image: debian:stretch
124+
steps:
125+
- checkout
126+
- run:
127+
name: Greeting
128+
command: echo Hello, world.
129+
- run:
130+
name: Print the Current Time
131+
command: date
132+
133+
coverage:
134+
docker:
135+
- image: debian:stretch
136+
steps:
137+
- checkout
138+
- run:
139+
name: Greeting
140+
command: echo Hello, world.
141+
- run:
142+
name: Print the Current Time
143+
command: date
144+
145+
146+
workflows:
147+
version: 2
148+
check_build_test:
149+
jobs:
150+
- checkout-code
151+
- cppcheck:
152+
requires:
153+
- checkout-code
154+
- shellcheck:
155+
requires:
156+
- checkout-code
157+
- cmake-format:
158+
requires:
159+
- checkout-code
160+
- clang-tidy:
161+
requires:
162+
- checkout-code
163+
- build-gcc-7:
164+
requires:
165+
- cppcheck
166+
- shellcheck
167+
- cmake-format
168+
- build-gcc-8:
169+
requires:
170+
- cppcheck
171+
- shellcheck
172+
- cmake-format
173+
- build-clang-7-asan:
174+
requires:
175+
- cppcheck
176+
- shellcheck
177+
- cmake-format
178+
- unit-test:
179+
requires:
180+
- build-gcc-8
181+
- integration-test:
182+
requires:
183+
- build-gcc-8
184+
- unit-test-asan:
185+
requires:
186+
- build-clang-7-asan
187+
- coverage:
188+
requires:
189+
- unit-test

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ Following features are included:
4040
- [x] static code analysis tools like linters
4141
([`cppcheck`](cppcheck), [`clang-tidy`][clangtidy], [`shellcheck`][shcheck])
4242
- [x] continuous integration: useful not only for pull requests
43-
([Travis CI][travis], [AppVeyor][appveyor], [GitLab CI][gitlabci])
43+
([Travis CI][travis], [AppVeyor][appveyor], [GitLab CI][gitlabci],
44+
[Circle CI 2.0][circleci])
4445
- [ ] continuous deployment
4546
([Bintray][bintray]), [GitHub Pages][githubpg])
4647
- [x] code coverage using [Codecov][codecov]
@@ -110,6 +111,7 @@ Because we use range-v3 and other modern C++ features, we only support these com
110111
[appveyor]: https://ci.appveyor.com/project/archer96/cpp-starter-project
111112
[bintray]: https//bintray.com/
112113
[catch2]: https://github.com/catchorg/Catch2
114+
[circleci]: https://circleci.com/
113115
[clangfmt]: https://clang.llvm.org/docs/ClangFormat.html
114116
[clangtidy]: https://clang.llvm.org/extra/clang-tidy/
115117
[cmake]: https://cmake.org/

docs/cpp-starter/continuous-integration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ at https://gitlab.com/bugwelle/docker-modern-cpp-cmake
2727
It includes recent versions of GCC and clang, cppcheck and other usefule tools.
2828
By using custom docker images we could also use the latest C++ features
2929
available, etc.
30+
31+
## Circle CI
32+
Circle CI is free for open source projects. We use Circle CI's version 2
33+
format.

0 commit comments

Comments
 (0)