forked from cypress-io/cypress-realworld-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildspec.yml
69 lines (67 loc) · 2.46 KB
/
buildspec.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
version: 0.2
batch:
fast-fail: false
build-matrix:
static:
ignore-failure: false
env:
type: LINUX_CONTAINER
privileged-mode: true
compute-type: BUILD_GENERAL1_MEDIUM
dynamic:
env:
compute-type:
- BUILD_GENERAL1_MEDIUM
image:
- public.ecr.aws/cypress-io/cypress/browsers:node14.16.0-chrome90-ff88
variables:
CY_GROUP_SPEC:
- "UI - Chrome|chrome|cypress/tests/ui/*"
- "UI - Chrome - Mobile|chrome|cypress/tests/ui/*|viewportWidth=375,viewportHeight=667"
- "API|chrome|cypress/tests/api/*"
- "UI - Firefox|firefox|cypress/tests/ui/*"
- "UI - Firefox - Mobile|firefox|cypress/tests/ui/*|viewportWidth=375,viewportHeight=667"
WORKERS:
- 1
- 2
- 3
- 4
- 5
phases:
install:
commands:
# Set COMMIT_INFO variables to send Git specifics to Cypress Dashboard when recording
# https://docs.cypress.io/guides/continuous-integration/introduction#Git-information
- export COMMIT_INFO_BRANCH="$(git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed 's/remotes\/origin\///g')"
- export COMMIT_INFO_MESSAGE="$(git log -1 --pretty=%B)"
- export COMMIT_INFO_EMAIL="$(git log -1 --pretty=%ae)"
- export COMMIT_INFO_AUTHOR="$(git log -1 --pretty=%an)"
- export COMMIT_INFO_SHA="$(git log -1 --pretty=%H)"
- export COMMIT_INFO_REMOTE="$(git config --get remote.origin.url)"
- echo $COMMIT_INFO_BRANCH
- echo $COMMIT_INFO_MESSAGE
- echo $COMMIT_INFO_EMAIL
- echo $COMMIT_INFO_AUTHOR
- echo $COMMIT_INFO_SHA
- echo $COMMIT_INFO_REMOTE
- echo $CODEBUILD_INITIATOR
- echo $CY_GROUP_SPEC
- CY_GROUP=$(echo $CY_GROUP_SPEC | cut -d'|' -f1)
- CY_BROWSER=$(echo $CY_GROUP_SPEC | cut -d'|' -f2)
- CY_SPEC=$(echo $CY_GROUP_SPEC | cut -d'|' -f3)
- CY_CONFIG=$(echo $CY_GROUP_SPEC | cut -d'|' -f4)
- echo $CY_GROUP
- echo $CY_BROWSER
- echo $CY_SPEC
- echo $CY_CONFIG
- yarn install --frozen-lockfile
pre_build:
commands:
- yarn types
- yarn lint
- yarn test:unit:ci
- yarn build:ci
build:
commands:
- yarn start:ci & npx wait-on http://localhost:3000
- npx cypress run --record --parallel --browser $CY_BROWSER --ci-build-id $CODEBUILD_INITIATOR --group "$CY_GROUP" --spec "$CY_SPEC" --config "$CY_CONFIG"