github.com/gobuffalo/buffalo-cli/v2@v2.0.0-alpha.15.0.20200919213536-a7350c8e6799/cli/internal/plugins/ci/templates/circleci.yml.tmpl (about) 1 version: 2 2 jobs: 3 build: 4 docker: 5 - image: circleci/golang:1.14 6 {{- if eq .Database "postgres" }} 7 - image: circleci/postgres:9.6-alpine 8 environment: 9 POSTGRES_USER: postgres 10 POSTGRES_DB: {{.Name}}_test 11 {{- end}} 12 13 environment: 14 TEST_RESULTS: /tmp/test-results 15 16 steps: 17 - checkout 18 - run: mkdir -p $TEST_RESULTS 19 20 - restore_cache: 21 keys: 22 - v1-pkg-cache 23 24 - run: go get github.com/jstemmer/go-junit-report 25 26 - run: go get github.com/gobuffalo/buffalo-cli/v2/cmd/buffalo@latest 27 - run: go mod download 28 29 - run: 30 name: Run unit tests 31 command: | 32 trap "go-junit-report <${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT 33 buffalo test | tee ${TEST_RESULTS}/go-test.out 34 35 - save_cache: 36 key: v1-pkg-cache 37 paths: 38 - "/go/pkg" 39 40 - store_artifacts: 41 path: /tmp/test-results 42 destination: raw-test-output 43 44 - store_test_results: 45 path: /tmp/test-results