mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Reviewed By: a8m Differential Revision: D17761242 fbshipit-source-id: 7ebf67b59eed722ac329b5ab6a152140a013c64c
93 lines
2.3 KiB
YAML
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
|