forked from cypress-io/cypress-test-nested-projects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
68 lines (63 loc) · 2.03 KB
/
circle.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
version: 2.1
commands:
early-stop:
description: |
Early halt if this commit is for testing binaries for different platform
Place this command AFTER checkout command because we need to look
at the commit subject text
parameters:
substring:
type: string
description: String to search for in the commit subject to skip build
steps:
- run:
name: Checking OS platform for "<< parameters.substring >>"
command: |
subject=$(git show -s --pretty=%s)
echo "Commit subject: $subject"
if [[ $subject == *"<< parameters.substring >>"* ]]; then
echo Skipping testing binary ⏭
echo Found string "<< parameters.substring >>"
circleci step halt
fi
jobs:
test:
docker:
- image: cypress/base:10
steps:
- checkout
- early-stop:
# we should not test Mac binary on Linux machines
substring: Testing new darwin
- restore_cache:
keys:
- cache-{{ checksum "package.json" }}
- run: npm ci
- save_cache:
key: cache-{{ checksum "package.json" }}
paths:
- ~/.npm
- ~/.cache
- run: npm install @cypress/commit-message-install
# now install just a specific version of Cypress (from commit message)
# or latest version of Cypress
- run:
name: Install Cypress
command: $(npm bin)/commit-message-install --else "npm i cypress"
- run: $(npm bin)/cypress verify
- run: npm test
# if needed, set the Cypress commit status
- run:
when: on_success
name: Set status check
command: $(npm bin)/set-status --state success --description "on CircleCI"
- run:
when: on_fail
name: Set status check
command: $(npm bin)/set-status --state failure --description "on CircleCI"
workflows:
version: 2
build:
jobs:
- test:
context: test-runner:commit-status-checks