cosmos-sdk/.circleci/config.yml

115 lines
2.5 KiB
YAML

version: 2.1
executors:
golang:
docker:
- image: circleci/golang:1.14
docs:
docker:
- image: tendermintdev/docker-website-deployment
environment:
AWS_REGION: us-east-1
protoc:
docker:
- image: tendermintdev/docker-protoc
commands:
make:
parameters:
description:
type: string
target:
type: string
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
name: "Restore source code cache"
keys:
- go-src-v1-{{ .Revision }}
- checkout
- restore_cache:
name: "Restore go modules cache"
keys:
- go-mod-v2-{{ checksum "go.sum" }}
- run:
name: << parameters.description >>
command: |
make << parameters.target >>
jobs:
build-docs:
executor: docs
steps:
- checkout
- run:
name: "Build docs"
command: make build-docs
- run:
name: "Upload docs to S3"
command: make sync-docs
setup-dependencies:
executor: golang
steps:
- checkout
- restore_cache:
name: "Restore go modules cache"
keys:
- go-mod-v2-{{ checksum "go.sum" }}
- run:
name: Cache go modules
command: make go-mod-cache
- run:
name: Build
command: make build
- run:
name: Git garbage collection
command: git gc
- save_cache:
name: "Save go modules cache"
key: go-mod-v2-{{ checksum "go.sum" }}
paths:
- "/go/pkg/mod"
- save_cache:
name: "Save source code cache"
key: go-src-v1-{{ .Revision }}
paths:
- ".git"
update-swagger-docs:
executor: golang
steps:
- make:
target: update-swagger-docs
description: "Check if statik.go is up-to-date"
workflows:
version: 2
test-suite:
jobs:
- update-swagger-docs:
requires:
- setup-dependencies
- setup-dependencies:
# This filter enables the job for tags
filters:
tags:
only:
- /^v.*/
- build-docs:
context: docs-deployment-master
filters:
branches:
only:
- docs-staging
- build-docs:
context: docs-deployment-release
filters:
branches:
only:
- master
tags:
only:
- /v.*/