Skip to content

Commit

Permalink
Migrate to Circle 2.0
Browse files Browse the repository at this point in the history
Also took this opportunity to switch to the new test reporter, and bump
Ruby, since the image wasn't building with the old base image.
  • Loading branch information
maxjacobson committed Jun 21, 2019
1 parent fec9819 commit 083e9a7
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 14 deletions.
29 changes: 29 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
jobs:
build_and_test:
docker:
- image: circleci/python:latest
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true

- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > cc-test-reporter
- run: chmod +x ./cc-test-reporter
- run: ./cc-test-reporter before-build
- run: make image
- run: make test
- run:
name: "Upload coverage"
command: ./cc-test-reporter after-build --prefix="/usr/src/app"
environment:
CC_TEST_REPORTER_ID: 45c013b6d2380a087f53ebc237a799b3ca09f1a3b05ddf96982637d42a9d6861

workflows:
version: 2
build_deploy:
jobs:
- build_and_test
notify:
webhooks:
- url: https://cc-slack-proxy.herokuapp.com/circle
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.3.0-slim
FROM ruby:2.6.3-slim

ENV LANG C.UTF-8

Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ gem "rake"
group :test do
gem "rspec"
gem "simplecov"
gem "codeclimate-test-reporter", "~> 1.0.0"
end
5 changes: 1 addition & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
GEM
remote: https://rubygems.org/
specs:
codeclimate-test-reporter (1.0.4)
simplecov
diff-lcs (1.2.5)
docile (1.1.5)
json (2.0.2)
Expand Down Expand Up @@ -38,12 +36,11 @@ PLATFORMS
ruby

DEPENDENCIES
codeclimate-test-reporter (~> 1.0.0)
mdl (~> 0.4.0)
posix-spawn
rake
rspec
simplecov

BUNDLED WITH
1.13.7
1.17.2
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ image:
docker build --rm -t $(IMAGE_NAME) .

test: image
docker run --rm \
--env CIRCLECI \
--env CIRCLE_BUILD_NUM \
--env CIRCLE_BRANCH \
--env CIRCLE_SHA1 \
--env CODECLIMATE_REPO_TOKEN \
docker run \
--name "markdownlint-${CIRCLE_WORKFLOW_ID}" \
--workdir /usr/src/app \
--volume "$(PWD)/.git:/usr/src/app/.git" \
$(IMAGE_NAME) sh -c "bundle exec rake && bundle exec codeclimate-test-reporter"
$(IMAGE_NAME) bundle exec rake
docker cp "markdownlint-${CIRCLE_WORKFLOW_ID}":/usr/src/app/coverage ./coverage

0 comments on commit 083e9a7

Please sign in to comment.