-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
96 lines (93 loc) · 2.46 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: 2.1
orbs:
aws-cli: circleci/[email protected]
jobs:
unit:
docker:
- image: circleci/golang
working_directory: /go/src/github.com/facebookincubator/ent
steps:
- run: &goimports_install
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:
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: *goimports_install
- 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