Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 2
version: 2.1
jobs:
build:
docker:
Expand Down Expand Up @@ -38,8 +38,12 @@ jobs:
path: ~/test-results
- store_artifacts:
path: ~/test-results/junit
- persist_to_workspace:
root: .
paths:
- .

release:
ktlint:
docker:
- image: circleci/openjdk:8-jdk
working_directory: ~/protok
Expand All @@ -48,25 +52,26 @@ jobs:
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m
TERM: dumb
branches:
only:
- master
steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: gradle dependencies

- save_cache:
paths:
- ~/.gradle
key: v1-dependencies-{{ checksum "build.gradle" }}
- attach_workspace:
at: .
- run:
name: Install ktlint
command: |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.34.2/ktlint
chmod a+x ktlint
echo 'export PATH=/home/circleci/repo:$PATH' >> $BASH_ENV
source $BASH_ENV
- run:
name: Put comments indicated by Danger
command: |
gem install bundle
bundle install --path vendor/bundle
bundle exec danger --dangerfile=Dangerfile --danger_id="danger"
when: always

# run tests!
- run: gradle jar
workflows:
branch:
jobs:
- build
- ktlint
4 changes: 4 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Stop reporting warnings/errors on the code out of range
github.dismiss_out_of_range_messages

ktlint.lint(inline_mode: true)
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true
source "https://rubygems.org"

gem 'danger'
gem 'danger-ktlint'