Files
ent/.circleci/config.yml
Alex Snast d581e01bb6 ent/circleci: drop goimports installation
Reviewed By: a8m

Differential Revision: D17761242

fbshipit-source-id: 7ebf67b59eed722ac329b5ab6a152140a013c64c
2019-10-05 10:15:47 -07:00

93 lines
2.3 KiB
YAML

version: 2.1
orbs:
aws-cli: circleci/aws-cli@0.1.13
jobs:
unit:
docker:
- image: circleci/golang
working_directory: /go/src/github.com/facebookincubator/ent
steps:
- 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:
docker:
- image: circleci/golang
- image: mysql:5.6.35
environment: &mysql_env
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: pass
- image: mysql:5.7.26
environment:
<<: *mysql_env
MYSQL_TCP_PORT: 3307
- image: mysql:8
environment:
<<: *mysql_env
MYSQL_TCP_PORT: 3308
- image: entgo/gremlin-server
entrypoint: /opt/gremlin-server/bin/gremlin-server.sh
command: conf/gremlin-server.yaml
steps:
- checkout
- run:
name: Run integration tests
working_directory: entc/integration
command: go test -v -race ./...
docs:
docker:
- image: circleci/node
steps:
- checkout
- run:
name: Checking Docs Modified
command: |
if [[ ! $(git diff master^ --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/*"
- run:
name: Invalidate Cache
command: aws cloudfront create-invalidation --distribution-id $CDN_DISTRIBUTION_ID --paths "/*" | jq -M "del(.Location)"
workflows:
version: 2.1
all:
jobs:
- unit
- integration:
requires:
- unit
- docs:
requires:
- integration
filters:
branches:
only: master