Skip to content

Commit df8d5f2

Browse files
authored
Merge pull request #95 from Slicer/update-circleci-config-to-v2
Update continuous integration infrastructure to CircleCI v2.0
2 parents 795e671 + 4018890 commit df8d5f2

File tree

7 files changed

+194
-112
lines changed

7 files changed

+194
-112
lines changed

.circleci/config.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
build-settings: &build-settings
2+
working_directory: /usr/src/SlicerExecutionModel
3+
4+
version: 2
5+
jobs:
6+
itk-v4.8.0_use_system_libraries-off:
7+
<<: *build-settings
8+
docker:
9+
- image: slicer/slicerexecutionmodel:itk-v4.8.0_use_system_libraries-off
10+
steps:
11+
- checkout
12+
- run:
13+
name: Configure, build and test
14+
command: |
15+
./test/Docker/test.sh itk-v4.8.0_use_system_libraries-off
16+
17+
itk-v4.10.1_use_system_libraries-off:
18+
<<: *build-settings
19+
docker:
20+
- image: slicer/slicerexecutionmodel:itk-v4.10.1_use_system_libraries-off
21+
steps:
22+
- checkout
23+
- run:
24+
name: Configure, build and test
25+
command: |
26+
./test/Docker/test.sh itk-v4.8.0_use_system_libraries-off
27+
28+
29+
itk-v4.10.1_use_system_libraries-off_serializer:
30+
<<: *build-settings
31+
docker:
32+
- image: slicer/slicerexecutionmodel:itk-v4.10.1_use_system_libraries-off
33+
steps:
34+
- checkout
35+
- run:
36+
name: Configure, build and test
37+
command: |
38+
./test/Docker/test-serializer.sh itk-v4.10.1_use_system_libraries-off
39+
40+
workflows:
41+
version: 2
42+
build-test:
43+
jobs:
44+
- itk-v4.8.0_use_system_libraries-off
45+
- itk-v4.10.1_use_system_libraries-off
46+
- itk-v4.10.1_use_system_libraries-off_serializer

README.md

Lines changed: 80 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ SlicerExecutionModel
33

44
[![Circle CI](https://circleci.com/gh/Slicer/SlicerExecutionModel.svg?style=svg)](https://circleci.com/gh/Slicer/SlicerExecutionModel)
55

6-
[![](https://images.microbadger.com/badges/image/slicer/slicerexecutionmodel.svg)](https://microbadger.com/images/slicer/slicerexecutionmodel)
7-
86
Overview
97
--------
108

@@ -16,20 +14,88 @@ SlicerExecutionModel is documented here: https://www.slicer.org/wiki/Documentati
1614
Contributing
1715
------------
1816

19-
Once you've made your great commits:
17+
There are many ways to contribute to SlicerExecutionModel, with varying levels of effort. Do try to
18+
look through the documentation first if something is unclear, and let us know how we can
19+
do better.
20+
21+
- Ask a question on the [Slicer forum][forum]
22+
- Submit a feature request or bug, or add to the discussion on the [issue tracker][is]
23+
- Submit a [Pull Request][pr] to improve the SlicerExecutionModel or its documentation
24+
25+
We encourage a range of contributions, from patches that include passing tests and
26+
documentation, all the way down to half-baked ideas that launch discussions.
27+
28+
29+
### How to submit a PR
30+
31+
If you are new to SlicerExecutionModel development and you don't have push access to the
32+
SlicerExecutionModel repository, here are the steps:
33+
34+
1. [Fork and clone](https://help.github.com/articles/fork-a-repo/) the repository.
35+
2. Create a branch.
36+
3. [Push](https://help.github.com/articles/pushing-to-a-remote/) the branch to your GitHub fork.
37+
4. Create a [Pull Request][pr].
38+
39+
This corresponds to the ``Fork & Pull Model`` mentioned in the
40+
[GitHub flow](https://guides.github.com/introduction/flow/index.html) guides.
41+
42+
If you have push access to SlicerExecutionModel repository, you could simply push your branch
43+
into the main repository and create a [Pull Request][pr]. This
44+
corresponds to the ``Shared Repository Model`` and will facilitate other developers to checkout your
45+
topic without having to [configure a remote](https://help.github.com/articles/configuring-a-remote-for-a-fork/).
46+
It will also simplify the workflow when you are *co-developing* a branch.
47+
48+
When submitting a PR, make sure to add a ``Cc: @slicer/slicerexecutionmodel`` comment to notify SlicerExecutionModel
49+
developers of your awesome contributions. Based on the
50+
comments posted by the reviewers, you may have to revisit your patches.
51+
52+
53+
### Automatic testing of pull requests
54+
55+
When you submit a PR to the SlicerExecutionModel repo, CircleCI will run the build and test suite on the
56+
head of the branch. If you add new commits onto the branch, those will also automatically
57+
be run through the CI process. The status of the CI process (passing, failing, or in progress) will
58+
be displayed directly in the PR page in GitHub.
59+
60+
The CircleCI build will run according to the [circle.yml file](circle.yml),
61+
which is useful as an example for how to set up your own environment for testing.
62+
63+
Your test results will be posted on [SlicerExecutionModel's dashboard](http://slicer.cdash.org/index.php?project=SlicerExecutionModel).
64+
These results will list any failed tests. You can reach your
65+
build by clicking the build status link on your GitHub PR.
66+
67+
68+
### Testing environments
69+
70+
With each PR, SlicerExecutionModel is built and tested against multiple version of ITK. Each
71+
environment is made available in docker images:
72+
73+
* Each environment is described in a ``Dockerfile`` found in a ``Docker-ITK-vX.Y.Z`` subdirectory of [test](./test).
74+
* Testing using a given environment is enabled updating the [circle.yml](circle.yml) file.
75+
* Before enabling an environment, associated docker image has to be (1) built locally running the `build.sh` script
76+
and (2) manually pushed to [dockerhub](https://hub.docker.com/r/slicer/slicerexecutionmodel/tags/).
77+
78+
Available environments are:
79+
80+
* [![](https://images.microbadger.com/badges/version/slicer/slicerexecutionmodel:itk-v4.8.0_use_system_libraries-off.svg)](https://microbadger.com/images/slicer/slicerexecutionmodel:itk-v4.8.0_use_system_libraries-off)
81+
* [![](https://images.microbadger.com/badges/version/slicer/slicerexecutionmodel:itk-v4.10.1_use_system_libraries-off.svg)](https://microbadger.com/images/slicer/slicerexecutionmodel:itk-v4.10.1_use_system_libraries-off "Get your own version badge on microbadger.com")
82+
83+
84+
### How to integrate a PR
85+
86+
Getting your contributions integrated is relatively straightforward, here is the checklist:
87+
88+
- All tests pass
2089

21-
1. [Fork][fk] SlicerExecutionModel
22-
2. Create a topic branch - `git checkout -b my_branch`
23-
3. Push to your branch - `git push origin my_branch`
24-
4. Create an [Issue][is] with a link to your branch
25-
5. That's it!
90+
- Consensus is reached. This requires that a reviewer adds an "approved" review via GitHub with no
91+
changes requested, and a reasonable amount of time passed without anyone objecting.
2692

93+
Next, there are two scenarios:
2794

28-
Meta
29-
----
95+
- You do NOT have push access: A SlicerExecutionModel core developer will integrate your PR.
96+
- You have push access: Simply click on the "Merge pull request" button.
3097

31-
* Code: `git clone git://github.com/Slicer/SlicerExecutionModel`
32-
* Bugs: <http://github.com/Slicer/SlicerExecutionModel/issues>
98+
Then, click on the "Delete branch" button that appears afterward.
3399

34100
License
35101
-------
@@ -45,4 +111,6 @@ limitations under the License.
45111

46112
[fk]: http://help.github.com/forking/
47113
[is]: http://github.com/Slicer/SlicerExecutionModel/issues
114+
[pr]: http://github.com/Slicer/SlicerExecutionModel/pulls
115+
[forum]: https://discourse.slicer.org/
48116

circle.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

test/Docker-ITK-v4.10.1_USE_SYSTEM_LIBRARIES-OFF/Dockerfile

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
FROM debian:8
1+
FROM dockbuild/centos5
22
MAINTAINER Insight Software Consortium <community@itk.org>
33

4-
RUN apt-get update && apt-get install -y \
5-
build-essential \
6-
cmake \
7-
git \
8-
python \
9-
ninja-build \
10-
wget \
11-
vim
12-
13-
RUN mkdir -p /usr/src/SlicerExecutionModel-build
144
WORKDIR /usr/src
155

166
ENV ITK_GIT_TAG v4.10.1
17-
RUN git clone git://itk.org/ITK.git && \
18-
cd ITK && \
19-
git checkout ${ITK_GIT_TAG} && \
20-
cd ../ && \
21-
mkdir ITK-build && \
22-
cd ITK-build && \
7+
8+
RUN \
9+
#
10+
# Settings
11+
#
12+
working_dir=$(pwd) && \
13+
#
14+
# Checkout
15+
#
16+
git clone git://github.com/InsightSoftwareConsortium/ITK --single-branch -b ${ITK_GIT_TAG} ITK && \
17+
#
18+
# Configure
19+
#
20+
cd $working_dir && \
21+
mkdir ITK-build && cd $_ && \
2322
cmake \
2423
-G Ninja \
25-
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
24+
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
2625
-DBUILD_EXAMPLES:BOOL=OFF \
2726
-DBUILD_TESTING:BOOL=OFF \
2827
-DBUILD_SHARED_LIBS:BOOL=ON \
@@ -34,8 +33,14 @@ RUN git clone git://itk.org/ITK.git && \
3433
-DModule_ITKIOXML:BOOL=ON \
3534
-DModule_ITKExpat:BOOL=ON \
3635
../ITK && \
36+
#
37+
# Build and install
38+
#
3739
ninja install && \
38-
rm -rf ITK ITK-build
40+
#
41+
# Cleanup
42+
#
43+
rm -rf $working_dir/ITK $working_dir/ITK-build
3944

4045
# Build-time metadata as defined at http://label-schema.org
4146
ARG BUILD_DATE

test/Docker-ITK-v4.8.0_USE_SYSTEM_LIBRARIES-OFF/Dockerfile

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
FROM debian:8
1+
FROM dockbuild/centos5
22
MAINTAINER Insight Software Consortium <community@itk.org>
33

4-
RUN apt-get update && apt-get install -y \
5-
build-essential \
6-
cmake \
7-
git \
8-
python \
9-
ninja-build \
10-
wget \
11-
vim
12-
13-
RUN mkdir -p /usr/src/SlicerExecutionModel-build
144
WORKDIR /usr/src
155

166
ENV ITK_GIT_TAG v4.8.0
17-
RUN git clone git://itk.org/ITK.git && \
18-
cd ITK && \
19-
git checkout ${ITK_GIT_TAG} && \
20-
cd ../ && \
21-
mkdir ITK-build && \
22-
cd ITK-build && \
7+
8+
RUN \
9+
#
10+
# Settings
11+
#
12+
working_dir=$(pwd) && \
13+
#
14+
# Checkout
15+
#
16+
git clone git://github.com/InsightSoftwareConsortium/ITK --single-branch -b ${ITK_GIT_TAG} ITK && \
17+
#
18+
# Configure
19+
#
20+
cd $working_dir && \
21+
mkdir ITK-build && cd $_ && \
2322
cmake \
2423
-G Ninja \
25-
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
24+
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
2625
-DBUILD_EXAMPLES:BOOL=OFF \
2726
-DBUILD_TESTING:BOOL=OFF \
2827
-DBUILD_SHARED_LIBS:BOOL=ON \
@@ -34,8 +33,14 @@ RUN git clone git://itk.org/ITK.git && \
3433
-DModule_ITKIOXML:BOOL=ON \
3534
-DModule_ITKExpat:BOOL=ON \
3635
../ITK && \
36+
#
37+
# Build and install
38+
#
3739
ninja install && \
38-
rm -rf ITK ITK-build
40+
#
41+
# Cleanup
42+
#
43+
rm -rf $working_dir/ITK $working_dir/ITK-build
3944

4045
# Build-time metadata as defined at http://label-schema.org
4146
ARG BUILD_DATE

test/Docker/test-serializer.sh

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
#!/bin/bash
22

3+
set -ex
4+
35
# This is a script to build the project and run the test suite in the base
46
# Docker container.
57

6-
die() {
7-
echo "Error: $@" 1>&2
8-
exit 1;
9-
}
10-
8+
# jsoncpp
9+
cd /usr/src
1110
git clone git://github.com/Slicer/jsoncpp.git
1211
mkdir jsoncpp-build && cd $_
1312
cmake -G Ninja \
@@ -19,30 +18,29 @@ cmake -G Ninja \
1918
-DJSONCPP_WITH_CMAKE_PACKAGE:BOOL=ON \
2019
-DBUILD_SHARED_LIBS:BOOL=ON \
2120
-DBUILD_STATIC_LIBS:BOOL=OFF \
22-
../jsoncpp || die "JsonCpp: CMake configuration failed"
23-
ninja install || die "JsonCpp: Build failed"
21+
../jsoncpp
22+
ninja install
2423

24+
# ParameterSerializer
2525
cd /usr/src
26-
27-
git clone git://github.com/jcfr/ParameterSerializer.git -b conditonally-add-subdirectory
26+
git clone git://github.com/Slicer/ParameterSerializer.git
2827
mkdir ParameterSerializer-build && cd $_
2928
cmake \
3029
-G Ninja \
3130
-DBUILD_TESTING:BOOL=OFF \
3231
-DCMAKE_BUILD_TYPE:STRING=Release \
33-
/usr/src/ParameterSerializer || die "ParameterSerializer: CMake configuration failed"
34-
ninja || die "ParameterSerializer: Build failed"
35-
36-
cd /usr/src/SlicerExecutionModel-build || die "Could not cd into the build directory"
32+
/usr/src/ParameterSerializer
33+
ninja
3734

35+
# SlicerExecutionModel
36+
mkdir -p /usr/src/SlicerExecutionModel-build && cd $_
3837
BUILDNAME=sem_use_serializer-on_$1
39-
4038
cmake \
4139
-G Ninja \
4240
-DCMAKE_BUILD_TYPE:STRING=Release \
4341
-DBUILDNAME:STRING=$BUILDNAME \
4442
-DParameterSerializer_DIR:PATH=/usr/src/ParameterSerializer-build \
4543
-DSlicerExecutionModel_USE_SERIALIZER:BOOL=ON \
4644
-DSlicerExecutionModel_USE_JSONCPP:BOOL=ON \
47-
/usr/src/SlicerExecutionModel || die "SlicerExecutionModel: CMake configuration failed"
48-
ctest -VV -D Experimental || die "SlicerExecutionModel: ctest failed"
45+
/usr/src/SlicerExecutionModel
46+
ctest -VV -D Experimental

0 commit comments

Comments
 (0)