Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5fcaeda
First experiment enabling CircleCI.
nedtwigg May 5, 2020
97c0baf
Add a fallthrough for caching deps
nedtwigg May 5, 2020
4f263cf
No test results to store in `assemble_testClasses`
nedtwigg May 5, 2020
9b7832b
Stop wasting travis resources as I debug CircleCI issues.
nedtwigg May 5, 2020
7467d9e
Add tests under JRE 8 and 11
nedtwigg May 5, 2020
38826a6
Add the maven plugin tests.
nedtwigg May 5, 2020
a014439
YAML is terrible, fix indentation.
nedtwigg May 5, 2020
1010bed
YAML is soooo bad.
nedtwigg May 5, 2020
d14bf01
Simplify jobs for testing.
nedtwigg May 5, 2020
8da7ed8
Use anchors to make config.yml less verbose.
nedtwigg May 5, 2020
6994a31
More anchor refactoring.
nedtwigg May 5, 2020
b3fdca0
FIX INDENTATION.
nedtwigg May 5, 2020
6c6e794
More refactoring.
nedtwigg May 5, 2020
354ef8d
Add missing @Category(NpmTest.class) for plugin-maven.
nedtwigg May 5, 2020
718e93d
Try caching the local maven repo.
nedtwigg May 5, 2020
e27ba97
Move the docker image into the `env_gradle` anchor.
nedtwigg May 5, 2020
25648f1
Fix the npmTest setup in plugin-maven.
nedtwigg May 5, 2020
6c33083
Add the npm tests
nedtwigg May 5, 2020
40b2e3f
Add the changelogPrint task under the deploy workflow.
nedtwigg May 5, 2020
b703fd7
Add a deploy workflow.
nedtwigg May 5, 2020
046ebe3
Fix the maven test results directory.
nedtwigg May 5, 2020
a622cb0
Remove the branch filters so we can test the deploy pipeline.
nedtwigg May 5, 2020
6eb290a
Add node to the npm test (duh!)
nedtwigg May 5, 2020
7d836af
YAML is terrible
nedtwigg May 5, 2020
248c899
Switch to cimg
nedtwigg May 5, 2020
cc78806
Fix npm tests.
nedtwigg May 5, 2020
54e7e32
Take another shot at the release pipeline.
nedtwigg May 5, 2020
56ee6f5
Should be ready for first deployment with CircleCI!
nedtwigg May 5, 2020
a5dd578
YAML!!!
nedtwigg May 5, 2020
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
181 changes: 181 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
anchors:
env_gradle: &env_gradle
parallelism: 2
environment:
_JAVA_OPTIONS: "-Xmx3g"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2"
docker:
- image: cimg/openjdk:8.0

restore_cache_wrapper: &restore_cache_wrapper
restore_cache:
key: gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
restore_cache_deps: &restore_cache_deps
restore_cache:
keys:
- gradle-deps2-{{ checksum "build.gradle" }}-{{ checksum "gradle.properties" }}
- gradle-deps2-
test_nomaven: &test_nomaven
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew check
command: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew check --build-cache
- store_test_results:
path: testlib/build/test-results/test
- store_test_results:
path: lib-extra/build/test-results/test
- store_test_results:
path: plugin-gradle/build/test-results/test

version: 2
jobs:
# gradlew spotlessCheck assemble testClasses
assemble_testClasses:
<<: *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew spotlessCheck assemble testClasses
command: ./gradlew spotlessCheck assemble testClasses --build-cache
- run:
name: prepare to cache
command: rm -rf ~/project/plugin-maven/build/localMavenRepository/com/diffplug/spotless/
- save_cache:
paths:
- ~/.gradle/wrapper
key: gradle-wrapper-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}
- save_cache:
paths:
- ~/.gradle/caches
- ~/.m2
- ~/project/plugin-maven/build/localMavenRepository
key: gradle-deps2-{{ checksum "build.gradle" }}-{{ checksum "gradle.properties" }}
# JRE8: export SPOTLESS_EXCLUDE_MAVEN=true && ./gradlew check
test_nomaven_8:
<<: *env_gradle
<<: *test_nomaven
test_nomaven_11:
<<: *env_gradle
docker:
- image: cimg/openjdk:11.0
<<: *test_nomaven
test_justmaven_8:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew :plugin-maven:check
command: ./gradlew :plugin-maven:check --build-cache
- store_test_results:
path: plugin-maven/build/test-results/test
test_npm_8:
<< : *env_gradle
docker:
- image: cimg/openjdk:8.0-node
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew npmTest
command: ./gradlew npmTest --build-cache
- store_test_results:
path: testlib/build/test-results/npm
- store_test_results:
path: plugin-maven/build/test-results/npm
- store_test_results:
path: plugin-gradle/build/test-results/npm
changelog_print:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew changelogPrint
command: ./gradlew changelogPrint
do_release_all:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew :changelogPush
command: ./gradlew :changelogPush -Prelease=true --build-cache
- run:
name: gradlew :plugin-gradle:changelogPush
command: ./gradlew :plugin-gradle:changelogPush -Prelease=true --build-cache -Pgradle.publish.key=${gradle_key} -Pgradle.publish.secret=${gradle_secret}
- run:
name: gradlew :plugin-maven:changelogPush
command: ./gradlew :plugin-maven:changelogPush -Prelease=true --build-cache
do_release_plugin_gradle:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew :plugin-gradle:changelogPush
command: ./gradlew :plugin-gradle:changelogPush -Prelease=true --build-cache -Pgradle.publish.key=${gradle_key} -Pgradle.publish.secret=${gradle_secret}
do_release_plugin_maven:
<< : *env_gradle
steps:
- checkout
- *restore_cache_wrapper
- *restore_cache_deps
- run:
name: gradlew :plugin-maven:changelogPush
command: ./gradlew :plugin-maven:changelogPush -Prelease=true --build-cache

workflows:
version: 2
assemble_and_test:
jobs:
- assemble_testClasses
- test_justmaven_8:
requires:
- assemble_testClasses
- test_nomaven_8:
requires:
- assemble_testClasses
- test_nomaven_11:
requires:
- assemble_testClasses
- test_npm_8:
requires:
- assemble_testClasses
deploy:
jobs:
- changelog_print:
filters:
branches:
only: master
- release_all:
type: approval
requires:
- changelog_print
- do_release_all:
requires:
- release_all
- release_plugin_gradle:
type: approval
requires:
- changelog_print
- do_release_plugin_gradle:
requires:
- release_plugin_gradle
- release_plugin_maven:
type: approval
requires:
- changelog_print
- do_release_plugin_maven:
requires:
- release_plugin_maven
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

18 changes: 13 additions & 5 deletions plugin-maven/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,20 @@ jar.doLast {
Files.copy(jarIn.toPath(), jarOut.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING)
}

// usually test only depends on testClasses, which doesn't run the maven build that we need
test.dependsOn(jar)

test {
testLogging { exceptionFormat = 'full' }
// pass location of the local maven repository and plugin version to junit tests
useJUnit {
excludeCategories 'com.diffplug.spotless.category.NpmTest'
}
}
task npmTest(type: Test) {
useJUnit {
includeCategories 'com.diffplug.spotless.category.NpmTest'
}
}
tasks.withType(Test) {
systemProperty "localMavenRepositoryDir", LOCAL_MAVEN_REPO_DIR
systemProperty "spotlessMavenPluginVersion", project.version
}
// usually test only depends on testClasses, which doesn't run the maven build that we need
test.dependsOn(jar)
npmTest.dependsOn(jar)
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
import java.io.IOException;

import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.diffplug.spotless.category.NpmTest;
import com.diffplug.spotless.maven.MavenIntegrationTest;
import com.diffplug.spotless.maven.MavenRunner;

@Category(NpmTest.class)
public class PrettierFormatStepTest extends MavenIntegrationTest {

private void run(String kind, String suffix) throws IOException, InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
import java.io.IOException;

import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.diffplug.spotless.category.NpmTest;
import com.diffplug.spotless.maven.MavenIntegrationTest;
import com.diffplug.spotless.maven.MavenRunner;

@Category(NpmTest.class)
public class TypescriptFormatStepTest extends MavenIntegrationTest {
private void run(String kind) throws IOException, InterruptedException {
String path = "src/main/typescript/test.ts";
Expand Down