Skip to content

Commit 0036097

Browse files
committed
[CircleCI] Add circle ci 2.0 support
1 parent 0b8e52e commit 0036097

3 files changed

Lines changed: 185 additions & 13 deletions

File tree

.circleci/config.yml

Lines changed: 179 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,189 @@ version: 2.1
55
# Define a job to be invoked later in a workflow.
66
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
77
jobs:
8-
say-hello:
9-
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
10-
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
8+
9+
checkout-code:
10+
docker:
11+
- image: debian:stretch
12+
steps:
13+
- checkout
14+
- save_cache:
15+
key: repo-{{ .Environment.CIRCLE_SHA1 }}
16+
paths:
17+
- ~/project
18+
19+
cppcheck:
20+
docker:
21+
- image: debian:stretch
22+
steps:
23+
- restore_cache:
24+
key: repo-{{ .Environment.CIRCLE_SHA1 }}
25+
- run:
26+
name: Greeting
27+
command: echo Hello, world.
28+
- run:
29+
name: Print the Current Time
30+
command: date
31+
32+
shellcheck:
33+
docker:
34+
- image: koalaman/shellcheck-alpine:stable
35+
steps:
36+
- checkout
37+
- run:
38+
name: Check Shell Scripts
39+
command: find . -type f -name "*.sh" -exec shellcheck -e SC2010 -e SC2016 {} \+
40+
41+
cmake-format:
42+
docker:
43+
- image: debian:stretch
44+
steps:
45+
- checkout
46+
- run:
47+
name: Greeting
48+
command: echo Hello, world.
49+
- run:
50+
name: Print the Current Time
51+
command: date
52+
53+
clang-tidy:
54+
docker:
55+
- image: debian:stretch
56+
steps:
57+
- checkout
58+
- run:
59+
name: Greeting
60+
command: echo Hello, world.
61+
- run:
62+
name: Print the Current Time
63+
command: date
64+
65+
build-gcc-7:
66+
docker:
67+
- image: debian:stretch
68+
steps:
69+
- checkout
70+
- run:
71+
name: Greeting
72+
command: echo Hello, world.
73+
- run:
74+
name: Print the Current Time
75+
command: date
76+
77+
build-gcc-8:
1178
docker:
12-
- image: cimg/base:stable
13-
# Add steps to the job
14-
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
79+
- image: debian:stretch
1580
steps:
1681
- checkout
1782
- run:
18-
name: "Say hello"
19-
command: "echo Hello, World!"
83+
name: Greeting
84+
command: echo Hello, world.
85+
- run:
86+
name: Print the Current Time
87+
command: date
88+
89+
build-clang-7:
90+
docker:
91+
- image: debian:stretch
92+
steps:
93+
- checkout
94+
- run:
95+
name: Greeting
96+
command: echo Hello, world.
97+
- run:
98+
name: Print the Current Time
99+
command: date
100+
101+
unit-test:
102+
docker:
103+
- image: debian:stretch
104+
steps:
105+
- checkout
106+
- run:
107+
name: Greeting
108+
command: echo Hello, world.
109+
- run:
110+
name: Print the Current Time
111+
command: date
112+
113+
integration-test:
114+
docker:
115+
- image: debian:stretch
116+
steps:
117+
- checkout
118+
- run:
119+
name: Greeting
120+
command: echo Hello, world.
121+
- run:
122+
name: Print the Current Time
123+
command: date
124+
125+
unit-test-asan:
126+
docker:
127+
- image: debian:stretch
128+
steps:
129+
- checkout
130+
- run:
131+
name: Greeting
132+
command: echo Hello, world.
133+
- run:
134+
name: Print the Current Time
135+
command: date
136+
137+
coverage:
138+
docker:
139+
- image: debian:stretch
140+
steps:
141+
- checkout
142+
- run:
143+
name: Greeting
144+
command: echo Hello, world.
145+
- run:
146+
name: Print the Current Time
147+
command: date
148+
20149

21-
# Invoke jobs via workflows
22-
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
23150
workflows:
24-
say-hello-workflow:
151+
version: 2
152+
check_build_test:
25153
jobs:
26-
- say-hello
154+
- checkout-code
155+
- cppcheck:
156+
requires:
157+
- checkout-code
158+
- shellcheck:
159+
requires:
160+
- checkout-code
161+
- cmake-format:
162+
requires:
163+
- checkout-code
164+
- clang-tidy:
165+
requires:
166+
- checkout-code
167+
- build-gcc-7:
168+
requires:
169+
- cppcheck
170+
- shellcheck
171+
- cmake-format
172+
- build-gcc-8:
173+
requires:
174+
- cppcheck
175+
- shellcheck
176+
- cmake-format
177+
- build-clang-7:
178+
requires:
179+
- cppcheck
180+
- shellcheck
181+
- cmake-format
182+
- unit-test:
183+
requires:
184+
- build-gcc-8
185+
- integration-test:
186+
requires:
187+
- build-gcc-8
188+
- unit-test-asan:
189+
requires:
190+
- build-clang-7
191+
- coverage:
192+
requires:
193+
- unit-test

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Following features are included:
4848
- [x] static code analysis tools like linters
4949
([`cppcheck`](cppcheck), [`clang-tidy`][clangtidy], [`shellcheck`][shcheck])
5050
- [x] continuous integration: useful not only for pull requests
51-
([Travis CI][travis], [AppVeyor][appveyor], [GitLab CI][gitlabci])
51+
([Travis CI][travis], [AppVeyor][appveyor],[Circle CI 2.0][circleci], [GitLab CI][gitlabci])
5252
- [ ] continuous deployment to [GitHub Pages][githubpg]
5353
- [x] code coverage using [Codecov][codecov]
5454
- [x] third-party package management using [conan][conan]
@@ -108,6 +108,7 @@ Because we use range-v3 and other modern C++ features, we only support these com
108108

109109
[appveyor]: https://ci.appveyor.com/project/archer96/cpp-starter-project
110110
[catch2]: https://github.com/catchorg/Catch2
111+
[circleci]: https://circleci.com/
111112
[clangfmt]: https://clang.llvm.org/docs/ClangFormat.html
112113
[clangtidy]: https://clang.llvm.org/extra/clang-tidy/
113114
[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)