Files
ent/.circleci/config.yml
Alex Snast 8b345d94bb ent/docs: circleci docs deployment
Summary: keeping docs in sync with entgo.io

Reviewed By: a8m

Differential Revision: D16937603

fbshipit-source-id: 1e07111c3db77ed49a768fc1d369a5ca6df5810e
2019-08-21 07:53:24 -07:00

86 lines
2.1 KiB
YAML

version: 2.1
orbs:
compare-url: iynere/compare-url@1.2.0
aws-cli: circleci/aws-cli@0.1.13
jobs:
unit:
docker:
- image: circleci/golang
working_directory: /go/src/github.com/facebookincubator/ent
steps:
- run:
name: Install goimports
command: go get -u golang.org/x/tools/cmd/goimports
- checkout
- run:
name: Dialect tests
command: go test -v ./dialect/...
- run:
name: Schema tests
command: go test -v ./schema/...
- run:
name: Loader tests
command: go test -v ./entc/load/...
- run:
name: Codegen tests
command: go test -v ./entc/gen/...
integration:
machine:
image: ubuntu-1604:201903-01
steps:
- checkout
- run:
name: Spin up databases
command: |
cd entc/integration/compose
docker-compose up -d --scale test=0
- run:
name: Run integration tests
command: |
cd entc/integration/compose
docker-compose run test go test ./entc/integration/...
docs:
docker:
- image: circleci/node
steps:
- checkout
- compare-url/reconstruct
- compare-url/use:
step-name: Checking Docs Modified
custom-logic: |
if [[ ! $(git diff $COMMIT_RANGE --name-only doc/ ]]; then
echo "docs not modified; no need to deploy"
circleci step halt
fi
- run:
name: Install Dependencies
working_directory: ~/project/doc/website
command: yarn
- run:
name: Build Docs
working_directory: ~/project/doc/website
command: yarn build
- aws-cli/install
- aws-cli/configure
- run:
name: Deploy Docs
working_directory: ~/project/doc/website/build/ent
command: aws s3 sync . s3://entgo.io --delete --exclude "assets/*"
workflows:
version: 2.1
all:
jobs:
- unit
- integration:
requires:
- unit
- docs:
requires:
- integration
filters:
branches:
only: master