Skip to content

Commit eafb509

Browse files
committed
Improve circleci execution
1 parent 4e1f5fe commit eafb509

File tree

1 file changed

+59
-9
lines changed

1 file changed

+59
-9
lines changed

.circleci/config.yml

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,74 @@ version: 2.1
66
orbs:
77
# use Cypress orb from CircleCI registry
88
cypress: cypress-io/cypress@1.14.0
9+
910
executors:
1011
with-chrome:
1112
docker:
12-
- image: 'cypress/browsers:node12.8.1-chrome80-ff72'
13+
- image: 'cypress/browsers:node14.16.0-chrome89-ff86'
1314
workflows:
1415
build:
1516
jobs:
16-
# runs tests using Chrome browser in custom executor (Cypress docker image)
17+
- cypress/install
18+
# runs tests using Chrome browser in custom executor (Cypress docker image)
1719
- cypress/run:
20+
requires:
21+
- cypress/install
22+
start: apt-get install -y sed && circleci tests glob "tests/e2e/*/*.js" | circleci tests split > circleci.tests && sed -i 's/No timing found for "//g' circleci.tests && sed -i 's/"//g' circleci.tests && sed -i 's/tests\/e2e\/plugins\/index.js//g' circleci.tests && sed -i 's/tests\/e2e\/.eslintrc.js//g' circleci.tests && sed -i 's/tests\/unit\/.eslintrc.js//g' circleci.tests && grep "\S" circleci.tests > uno.txt && mv uno.txt circleci.tests && cat circleci.tests && npm rebuild node-sass && npx browserslist@latest --update-db && npm run serve
23+
wait-on: 'http://localhost:8080'
1824
executor: with-chrome
1925
browser: chrome
20-
command: 'npm install -g npm@latest && npm run lint && npm test'
26+
#command: 'npm install -g npm@latest && npm run lint && npm test'
27+
command: 'npm install -g npm@latest && npm run lint && TZ=UTC npx vue-cli-service test:e2e --mode test --headless --browser chrome --reporter mocha-junit-reporter --reporter-options mochaFile=reports/mocha/test-results.xml --spec $(cat circleci.tests | tr "\n" ",")'
28+
parallel: true
29+
parallelism: 10
30+
post-steps:
31+
- run: mkdir coverage && mv .nyc_output/out.json coverage/coverage-$CIRCLE_NODE_INDEX-$(date +"%s%N").json
32+
- save_cache:
33+
paths:
34+
coverage/
35+
key: pm-{{ .Environment.CIRCLE_NODE_INDEX }}-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
36+
- run: ls -la coverage
37+
- cypress/run:
38+
requires:
39+
- cypress/run
40+
command: npm run test-unit
2141
post-steps:
42+
- restore_cache:
43+
keys:
44+
- pm-0-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
45+
- restore_cache:
46+
keys:
47+
- pm-1-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
48+
- restore_cache:
49+
keys:
50+
- pm-2-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
51+
- restore_cache:
52+
keys:
53+
- pm-3-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
54+
- restore_cache:
55+
keys:
56+
- pm-4-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
57+
- restore_cache:
58+
keys:
59+
- pm-5-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
60+
- restore_cache:
61+
keys:
62+
- pm-6-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
63+
- restore_cache:
64+
keys:
65+
- pm-7-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
66+
- restore_cache:
67+
keys:
68+
- pm-8-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
69+
- restore_cache:
70+
keys:
71+
- pm-9-{{ .Branch }}-{{ .Environment.CIRCLE_WORKFLOW_ID }}-coverage.json
72+
- run: ls -la coverage && cp jest-coverage/coverage-final.json coverage/from-jest.json
73+
- run: npx nyc merge coverage && mkdir .nyc_output
74+
- run: mv coverage.json .nyc_output/out.json
75+
- run: npx nyc report --reporter html --reporter text --reporter json-summary --report-dir combined-coverage
2276
- store_artifacts:
23-
path: coverage
77+
path: combined-coverage
2478
- store_test_results:
25-
path: test_summary_reports
26-
- store_artifacts:
27-
path: test_summary_reports/mocha/test-results.xml
28-
- store_artifacts:
29-
path: test_summary_reports/jest/junit.xml
79+
path: test_summary_reports

0 commit comments

Comments
 (0)