forked from aws-amplify/amplify-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
145 lines (142 loc) · 4.22 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
machine:
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
defaults: &defaults
working_directory: ~/app
docker:
- image: cypress/base:10
environment:
## this enables colors in the output
TERM: xterm
jobs:
build:
<<: *defaults
steps:
- checkout
- run: yarn config set workspaces-experimental true
- run: yarn
- run: yarn run bootstrap
- run: yarn run build
- run: yarn run coverage
- save_cache:
key: amplify-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache ## cache both yarn and Cypress
- save_cache:
key: amplify-ssh-deps-{{ .Branch }}
paths:
- ~/.ssh
- persist_to_workspace:
root: .
paths: .
unit_test:
<<: *defaults
steps:
- attach_workspace:
at: ./
- run: yarn run test --scope @aws-amplify/auth
- run: yarn run test --scope @aws-amplify/api
- run: yarn run test --scope @aws-amplify/analytics
- run: yarn run test --scope @aws-amplify/cache
- run: yarn run test --scope @aws-amplify/core
- run: yarn run test --scope @aws-amplify/interactions
- run: yarn run test --scope @aws-amplify/pubsub
- run: yarn run test --scope @aws-amplify/storage
- run: yarn run test --scope @aws-amplify/xr
- run: yarn run test --scope aws-amplify-react
- run: yarn run test --scope aws-amplify-angular
- run: yarn run test --scope aws-amplify-vue
integration_test_auth:
<<: *defaults
steps:
- attach_workspace:
at: ./
- restore_cache:
key: amplify-yarn-deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: "Link aws-amplify"
command: |
cd packages/aws-amplify
yarn link
- run:
name: "Link aws-amplify-react"
command: |
cd packages/aws-amplify-react
yarn link
- run:
name: "Clone auth test package, initialize mobilehub via cli, and link amplify packages"
command: |
mkdir ~/.ssh
echo $SSH_HOST_PUBLIC_KEY >> ~/.ssh/known_hosts
cd ~
git clone $AUTH_CLONE_URL
cd aws-amplify-cypress-auth
yarn
yarn link aws-amplify
yarn link aws-amplify-react
echo $AWS_EXPORTS_AUTH > src/aws-exports.js
- run:
name: "Start Auth test server in background"
command: |
cd ~/aws-amplify-cypress-auth
yarn start
background: true
- run:
name: "Run cypress tests for aws-amplify-react"
command: |
yarn cypress --scope aws-amplify-react
- store_artifacts:
path: /root/app/packages/aws-amplify-react/cypress/videos
- store_artifacts:
path: /root/app/packages/aws-amplify-react/cypress/screenshots
deploy:
<<: *defaults
steps:
- attach_workspace:
at: ./
- restore_cache:
keys:
- amplify-ssh-deps-{{ .Branch }}
- amplify-ssh-deps
- run:
name: "Publish to Amplify Package"
command: |
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npm whoami
git config --global user.email $GITHUB_EMAIL
git config --global user.name $GITHUB_USER
yarn run publish:$CIRCLE_BRANCH
else
echo "Skipping deploy."
fi
workflows:
version: 2
build_test_deploy:
jobs:
- build
- unit_test:
requires:
- build
- integration_test_auth:
filters:
branches:
only:
- release
- master
requires:
- build
- deploy:
filters:
branches:
only:
- release
- master
- beta
requires:
- unit_test