Skip to content

Commit d96a23a

Browse files
committed
chore(ci): Update browsers (#519)
* Update browsers * Config validate * Skip install * Use js config * Add checkout * Make cypress config cjs * Fix config * Fix executor * Cache binary * Cache binary * Cache binary * Copy binary * Fix executor * Fix executor * Fix executor * cp instead of mv * cp instead of mv * --chrome browser * install browsers inside job * install browsers inside job
1 parent 9964a36 commit d96a23a

12 files changed

+40
-32
lines changed

.circleci/config.yml

+36-28
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
version: 2.1
22
orbs:
3-
cypress: cypress-io/cypress@2.2.0
3+
cypress: cypress-io/cypress@3
44
jobs:
5+
install:
6+
executor: cypress/default
7+
steps:
8+
- checkout
9+
- attach_workspace:
10+
at: ~/
11+
- cypress/install:
12+
install-browsers: true
13+
install-command: yarn install --frozen-lockfile
14+
- persist_to_workspace:
15+
root: ~/
16+
paths: .
17+
518
build:
619
docker:
720
- image: cimg/node:lts
@@ -14,6 +27,22 @@ jobs:
1427
- persist_to_workspace:
1528
root: ~/
1629
paths: .
30+
run-tests-in-parallel:
31+
executor: cypress/default
32+
parallelism: 2
33+
steps:
34+
- attach_workspace:
35+
at: ~/
36+
- cypress/install:
37+
install-browsers: true
38+
install-command: "echo 'skipping install'"
39+
- cypress/run-tests:
40+
# following examples from
41+
# https://circleci.com/docs/2.0/parallelism-faster-jobs/
42+
cypress-command: |
43+
TESTFILES=$(circleci tests glob "cypress/e2e/**/*.cy.ts" | circleci tests split --total=2)
44+
echo "Test files for this machine are $TESTFILES"
45+
npx cypress run --browser chrome --spec $TESTFILES
1746
1847
release:
1948
docker:
@@ -29,35 +58,14 @@ jobs:
2958
workflows:
3059
build:
3160
jobs:
32-
- cypress/install:
33-
executor: cypress/base-16-14-2-slim
34-
yarn: true
61+
- install
3562
- build:
3663
requires:
37-
- cypress/install
38-
- cypress/run:
39-
executor: cypress/base-16-14-2-slim
40-
parallelism: 2
41-
# make sure app has been installed and built
42-
# before running tests across multiple machines
43-
# this avoids installing same dependencies 10 times
64+
- install
65+
- run-tests-in-parallel:
66+
name: Run Cypress tests
4467
requires:
45-
- cypress/install
46-
browser: chrome
47-
# notice a trick to avoid re-installing dependencies
48-
# in this job - a do-nothing "install-command" parameter
49-
install-command: echo 'Nothing to install in this job'
50-
yarn: true
51-
no-workspace: true
52-
# we are not going to use results from this job anywhere else
53-
record: false
54-
store_artifacts: true
55-
# following examples from
56-
# https://circleci.com/docs/2.0/parallelism-faster-jobs/
57-
command: |
58-
TESTFILES=$(circleci tests glob "cypress/e2e/**/*.cy.ts" | circleci tests split --total=2)
59-
echo "Test files for this machine are $TESTFILES"
60-
npx cypress run --spec $TESTFILES
68+
- install
6169
- release:
6270
name: NPM release
6371
filters:
@@ -66,4 +74,4 @@ workflows:
6674
- main
6775
requires:
6876
- build
69-
- cypress/run
77+
- Run Cypress tests
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { defineConfig } from 'cypress'
1+
const defineConfig = require("cypress").defineConfig;
22

3-
export default defineConfig({
3+
module.exports = defineConfig({
44
video: false,
55
e2e: {
66
// We've imported your old cypress plugins here.
77
// You may want to clean this up later by importing these.
88
setupNodeEvents(on, config) {
9-
return require('./cypress/plugins/index.js')(on, config)
9+
return require("./cypress/plugins/index.js")(on, config);
1010
},
1111
},
12-
})
12+
});
4.19 KB
Loading
Loading
Loading
Loading
4.34 KB
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)