Skip to content

Commit

Permalink
Port travis config to circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
Stein Fletcher committed May 21, 2020
1 parent 18ac98f commit 3566d93
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 1 deletion.
81 changes: 81 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
version: 2.1

defaults: &defaults
working_directory: /tmp/persist_to_workspace

orbs:
hugo: circleci/hugo@0.2
aws-s3: circleci/aws-s3@1.0.15

jobs:

test:
<<: *defaults
docker:
- image: circleci/golang:1.14

steps:
- checkout
- run:
name: run tests tools
command: make test test-examples
- persist_to_workspace:
root: /tmp/persist_to_workspace
paths:
- .

upload-coverage:
<<: *defaults
docker:
- image: circleci/golang:1.14
steps:
- attach_workspace:
at: /tmp/persist_to_workspace
- run:
name: install tools
command: |
go get -u -v github.com/axw/gocov/gocov
go get -u -v github.com/mattn/goveralls
- run:
name: generate coverage report
command: |
goveralls -coverprofile=coverage.out -service=circle-ci -repotoken $COVERALLS_TOKEN
deploy-docs:
<<: *defaults
docker:
- image: musitude/go-build
steps:
- attach_workspace:
at: /tmp/persist_to_workspace
- aws-s3/copy:
from: public/
to: $S3_BUCKET
- aws-s3/sync:
from: public/
overwrite: true
to: $S3_BUCKET

workflows:
version: 2

pipeline:
jobs:
- test:
filters:
branches:
only: feature/circleci
tags:
ignore: /.*/
- upload-coverage:
requires:
- test
- hugo/build:
requires:
- upload-coverage
html-proofer: true
source: docs/
version: '0.55'
- deploy-docs:
requires:
- hugo/build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func TestApi(t *testing.T) {
apitest.New().
Handler(handler).
Get("/hello").
BasicAuth("username:password").
BasicAuth("username", "password").
Expect(t).
Status(http.StatusOK).
End()
Expand Down

0 comments on commit 3566d93

Please sign in to comment.