diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..7607e27 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,29 @@ +version: 2.1 + +jobs: + build: + docker: + - image: cimg/base:stable + steps: + - checkout + - setup_remote_docker: + docker_layer_caching: true + - run: + name: Build Docker Container + command: docker build -t app . + - run: + name: Run Docker Tests + command: | + docker create --rm \ + -e TRAVIS_JOB_ID=$CIRCLE_BUILD_NUM \ + -e COVERALLS_REPO_TOKEN=$COVERALLS_REPO_TOKEN \ + --name app \ + app make coveralls + # CircleCI doesn't allow mounts/volumes on the docker runner + docker cp .git app:/app/.git + docker start -a app + +workflows: + default: + jobs: + - build diff --git a/Dockerfile b/Dockerfile index 8786340..303156d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM ubuntu RUN apt-get update && apt-get -y install build-essential git python3-pip -RUN pip install cpp-coveralls +RUN pip install 'pyyaml<6' cpp-coveralls -COPY . /src -WORKDIR src +COPY . /app +WORKDIR app CMD make test diff --git a/Makefile b/Makefile index 18e5a3d..99b4e0f 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,10 @@ $(TEST_OUT): $(TEST_OBJS) $(TOBJS) test: $(TEST_OUT) $< -coveralls: test +.coveralls.yml: + echo service_name: circleci > .coveralls.yml + +coveralls: test .coveralls.yml coveralls -b . -e external -e tests test-tidy: