diff --git a/.circleci/config.yml b/.circleci/config.yml index 5816bb16..ed5939cc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,102 +1,58 @@ +# This file was generated by the excavator check 'excavator/manage-circleci' as specified in .circleci/template.sh. +# To request a modification to the general template, file an issue on Excavator. +# To manually manage the CircleCI configuration for this project, remove the .circleci/template.sh file. + working_dir: &working_dir working_directory: /go/src/github.com/palantir/pkg -go-version: &go-version - run: go version - -godel-cache-restore: &godel-cache-restore - restore_cache: - keys: - - godel-cache-{{ checksum "godelw" }}-v1 - -godel-version: &godel-version - run: ./godelw version - -godel-cache-save: &godel-cache-save - save_cache: - key: godel-cache-{{ checksum "godelw" }}-v1 - paths: - - ~/.godel - -define-tests-dir: &define-tests-dir - run: echo 'export TESTS_DIR=/tmp/test-results' >> $BASH_ENV - -mkdir-tests-dir: &mkdir-tests-dir - run: mkdir -p "${TESTS_DIR}" - -go-install-packages: &go-install-packages - run: go install $(./godelw packages) - -godelw-verify: &godelw-verify - run: ./godelw verify --apply=false --junit-output="$TESTS_DIR/$CIRCLE_PROJECT_REPONAME-tests.xml" - -godelw-test: &godelw-test - run: ./godelw test --junit-output="$TESTS_DIR/$CIRCLE_PROJECT_REPONAME-tests.xml" - -store-test-results: &store-test-results - type: test-results-store - path: /tmp/test-results - -store-artifacts: &store-artifacts - type: artifacts-store - path: /tmp/test-results - destination: test-results +steps: &steps + - checkout + - restore_cache: + keys: + - godel-cache-{{ checksum "godelw" }}-{{ checksum "godel/config/godel.yml" }}-v1 + - run: ./godelw version + - save_cache: + key: godel-cache-{{ checksum "godelw" }}-{{ checksum "godel/config/godel.yml" }}-v1 + paths: + - ~/.godel + - run: echo 'export TESTS_DIR=/tmp/test-results' >> $BASH_ENV + - run: mkdir -p "${TESTS_DIR}" + - run: | + if [ ! -z "$VERIFY" ]; then + echo "Verify" && ./godelw verify --apply=false --junit-output="$TESTS_DIR/$CIRCLE_PROJECT_REPONAME-tests.xml" + else + echo "Test" && ./godelw test --junit-output="$TESTS_DIR/$CIRCLE_PROJECT_REPONAME-tests.xml" + fi + - type: test-results-store + path: /tmp/test-results + - type: artifacts-store + path: /tmp/test-results + destination: test-results version: 2 jobs: - go-1.10: + go-1.11: <<: *working_dir + environment: + VERIFY: 1 docker: - - image: golang:1.10.1 - steps: - - checkout - - *go-version - - *godel-cache-restore - - *godel-version - - *godel-cache-save - - *define-tests-dir - - *mkdir-tests-dir - - *go-install-packages - - *godelw-verify - - *store-test-results - - *store-artifacts - go-1.9: + - image: golang:1.11.2 + steps: *steps + go-1.10: <<: *working_dir docker: - - image: golang:1.9.5 - steps: - - checkout - - *go-version - - *godel-cache-restore - - *godel-version - - *godel-cache-save - - *define-tests-dir - - *mkdir-tests-dir - - *go-install-packages - - *godelw-verify - - *store-test-results - - *store-artifacts - go-1.8: + - image: golang:1.10.5 + steps: *steps + go-1.9: <<: *working_dir docker: - - image: golang:1.8.7 - steps: - - checkout - - *go-version - - *godel-cache-restore - - *godel-version - - *godel-cache-save - - *define-tests-dir - - *mkdir-tests-dir - - *go-install-packages - - *godelw-test - - *store-test-results - - *store-artifacts + - image: golang:1.9.7 + steps: *steps workflows: version: 2 - build-publish: + verify: jobs: + - go-1.11 - go-1.10 - go-1.9 - - go-1.8 diff --git a/Gopkg.lock b/Gopkg.lock index 285ae922..7a4922b5 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -25,7 +25,7 @@ "hcl/token", "json/parser", "json/scanner", - "json/token" + "json/token", ] revision = "392dba7d905ed5d04a5794ba89f558b27e2ba1ca" @@ -59,7 +59,7 @@ packages = [ "dirs", "errorstringer", - "gofiles" + "gofiles", ] revision = "b64318170fdef93b4462420e0badef8050dbb7ec" @@ -98,7 +98,7 @@ name = "github.com/spf13/afero" packages = [ ".", - "mem" + "mem", ] revision = "9be650865eab0c12963d8753212f4f9c66cdcf12" @@ -136,7 +136,7 @@ name = "github.com/stretchr/testify" packages = [ "assert", - "require" + "require", ] revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" version = "v1.2.1" @@ -154,7 +154,7 @@ "http2", "http2/hpack", "idna", - "lex/httplex" + "lex/httplex", ] revision = "66aacef3dd8a676686c7ae3716979581e8b03c47" @@ -176,7 +176,7 @@ "unicode/bidi", "unicode/cldr", "unicode/norm", - "unicode/rangetable" + "unicode/rangetable", ] revision = "6353ef0f924300eea566d3438817aa4d3374817e" diff --git a/godel/config/godel.properties b/godel/config/godel.properties index 6fae4596..29d8917e 100644 --- a/godel/config/godel.properties +++ b/godel/config/godel.properties @@ -1,2 +1,2 @@ -distributionURL=https://palantir.bintray.com/releases/com/palantir/godel/godel/2.8.0/godel-2.8.0.tgz -distributionSHA256=edaeb3676c6a7dee867d91c1013d0d1f503a4ab5d444d01c422c131bbeae876a +distributionURL=https://palantir.bintray.com/releases/com/palantir/godel/godel/2.10.0/godel-2.10.0.tgz +distributionSHA256=503074b9177d05152f3225a4bd8fa1516182f9c35d88796fbbdc975637e06c45 diff --git a/godelw b/godelw index 9e055e5c..78dc04e0 100755 --- a/godelw +++ b/godelw @@ -3,9 +3,9 @@ set -euo pipefail # Version and checksums for godel. Values are populated by the godel "dist" task. -VERSION=2.8.0 -DARWIN_CHECKSUM=c04635e7142159fc46a970bdeb3234c131a2e1da50c0e2ac17301ef031b31fa7 -LINUX_CHECKSUM=d30e08a6d6c26c4a8a0ef0984470da3ebeaa478cf9245cc8801645f81da79220 +VERSION=2.10.0 +DARWIN_CHECKSUM=2f2d8a62e598f8a7784c92a0e6325251efa347d3550187a290ab72a9ed44917c +LINUX_CHECKSUM=36f963816d8e06ab6f41711fd66a75706d3ddb376de4edef80e4fd09688c97f5 # Downloads file at URL to destination path using wget or curl. Prints an error and exits if wget or curl is not present. function download {