Skip to content

Commit

Permalink
Update CircleCI and Go (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmiyake authored Nov 6, 2018
1 parent 55589af commit 7fae951
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 95 deletions.
124 changes: 40 additions & 84 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions godel/config/godel.properties
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions godelw
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7fae951

Please sign in to comment.