Skip to content

Commit 24423d4

Browse files
authored
Merge pull request #18771 from ckeditor/use-docker-image-instead-of-machine-executor
Use Docker executor instead of Machine executor on CI
2 parents 120588f + 1e7fc71 commit 24423d4

File tree

5 files changed

+46
-30
lines changed

5 files changed

+46
-30
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ commands:
3838

3939
jobs:
4040
generate_configuration:
41-
machine: true
41+
docker:
42+
- image: cimg/node:22.12.0
4243
resource_class: medium
4344
parameters:
4445
isNightly:

.circleci/template.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# To modify commands to execute on CI review this file, and the script that generates it.
55
version: 2.1
66

7+
orbs:
8+
browser-tools: circleci/browser-tools@2.1.2
9+
710
# List of parameters must be synchronized between configuration files.
811
parameters:
912
isNightly:
@@ -40,14 +43,6 @@ commands:
4043
circleci step halt
4144
fi
4245
43-
prepare_environment_command:
44-
description: "Prepare environment (RAM, browsers, hosts, etc.)"
45-
steps:
46-
# CircleCI does not use the latest Chrome. Hence, we must install it manually.
47-
- run:
48-
name: Install the latest Chrome
49-
command: yarn ckeditor5-dev-ci-install-latest-chrome
50-
5146
install_ssh_keys_command:
5247
description: "Install SSH keys"
5348
steps:
@@ -67,9 +62,14 @@ commands:
6762
checkout_command:
6863
description: "Clone the CKEditor 5 repository with limited depth and branches"
6964
steps:
65+
- run:
66+
name: Add GitHub to known_hosts
67+
command: |
68+
mkdir -p ~/.ssh
69+
ssh-keyscan github.com >> ~/.ssh/known_hosts
7070
- run:
7171
name: Checkout code (single branch)
72-
command: git clone --single-branch --depth 10 --branch "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" .
72+
command: git clone --single-branch --depth 1 --branch "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" .
7373

7474
# In the PRs that come from forked repositories, we do not share secret variables.
7575
# Hence, some of the scripts will not be executed. See: https://github.com/ckeditor/ckeditor5/issues/7745.
@@ -101,13 +101,14 @@ commands:
101101
102102
jobs:
103103
cke5_manual:
104-
machine: true
104+
docker:
105+
- image: cimg/node:22.12.0-browsers
105106
resource_class: large
106107
steps:
107108
- checkout_command
108109
- halt_if_short_flow
109110
- bootstrap_repository_command
110-
- prepare_environment_command
111+
- browser-tools/install_chrome
111112
- install_newest_emoji
112113
- run:
113114
name: Prepare DLL builds in CKEditor 5
@@ -117,12 +118,12 @@ jobs:
117118
command: bash scripts/check-manual-tests.sh -r ckeditor5 -f ckeditor5
118119

119120
cke5_validators:
120-
machine: true
121+
docker:
122+
- image: cimg/node:22.12.0
121123
resource_class: medium
122124
steps:
123125
- checkout_command
124126
- bootstrap_repository_command
125-
- prepare_environment_command
126127
- run:
127128
when: always
128129
name: Validate versions of CKEditor 5 dependencies
@@ -161,14 +162,14 @@ jobs:
161162
command: yarn run validate-module-re-exports
162163

163164
cke5_coverage:
164-
machine: true
165+
docker:
166+
- image: cimg/node:22.12.0
165167
resource_class: medium
166168
steps:
167169
- community_verification_command
168170
- checkout_command
169171
- halt_if_short_flow
170172
- bootstrap_repository_command
171-
- prepare_environment_command
172173
- attach_workspace:
173174
at: .out
174175
- run:
@@ -185,7 +186,8 @@ jobs:
185186
command: npx coveralls -v < .out/combined_lcov.info
186187

187188
cke5_trigger_release_process:
188-
machine: true
189+
docker:
190+
- image: cimg/node:22.12.0
189191
resource_class: medium
190192
steps:
191193
- community_verification_command
@@ -213,7 +215,8 @@ jobs:
213215
command: yarn ckeditor5-dev-ci-trigger-circle-build
214216

215217
cke5_trigger_uber_ci:
216-
machine: true
218+
docker:
219+
- image: cimg/node:22.12.0
217220
resource_class: medium
218221
steps:
219222
- community_verification_command
@@ -224,13 +227,13 @@ jobs:
224227
command: yarn ckeditor5-dev-ci-trigger-circle-build
225228

226229
release_prepare:
227-
machine: true
230+
docker:
231+
- image: cimg/node:22.12.0
228232
resource_class: large
229233
steps:
230234
- checkout_command
231235
- halt_if_short_flow
232236
- bootstrap_repository_command
233-
- prepare_environment_command
234237
- run:
235238
name: Check if packages are ready to be released
236239
command: npm run release:prepare-packages -- --compile-only --verbose
@@ -242,7 +245,8 @@ jobs:
242245
command: yarn run check-dependencies
243246

244247
notify_ci_failure:
245-
machine: true
248+
docker:
249+
- image: cimg/node:22.12.0
246250
resource_class: medium
247251
parameters:
248252
hideAuthor:
@@ -261,7 +265,8 @@ jobs:
261265
no_output_timeout: 2h
262266

263267
stale_bot:
264-
machine: true
268+
docker:
269+
- image: cimg/node:22.12.0
265270
resource_class: medium
266271
steps:
267272
- checkout_command

scripts/ci/check-unit-tests-for-package.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function runTests( { packageName, checkCoverage, attempts = 3 } ) {
5454
'test',
5555
'--reporter=dots',
5656
'--production',
57+
'-b ChromeHeadless',
5758
`-f ${ shortName }`,
5859
checkCoverage ? '--coverage' : null
5960
].filter( Boolean );

scripts/ci/generate-circleci-configuration.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const bootstrapCommands = () => ( [
4242
'checkout_command',
4343
'halt_if_short_flow',
4444
'bootstrap_repository_command',
45-
'prepare_environment_command'
45+
'browser-tools/install_chrome'
4646
] );
4747

4848
const prepareCodeCoverageDirectories = () => ( {
@@ -120,7 +120,9 @@ const persistToWorkspace = fileName => ( {
120120
} );
121121

122122
config.jobs.cke5_tests_framework = {
123-
machine: true,
123+
docker: [
124+
{ image: 'cimg/node:22.12.0-browsers' }
125+
],
124126
steps: [
125127
...bootstrapCommands(),
126128
prepareCodeCoverageDirectories(),
@@ -136,7 +138,9 @@ const persistToWorkspace = fileName => ( {
136138
// Adding batches to the root `jobs`.
137139
featureTestBatches.forEach( ( batch, batchIndex ) => {
138140
config.jobs[ featureTestBatchNames[ batchIndex ] ] = {
139-
machine: true,
141+
docker: [
142+
{ image: 'cimg/node:22.12.0-browsers' }
143+
],
140144
steps: [
141145
...bootstrapCommands(),
142146
'install_newest_emoji',

scripts/web-crawler/index.mjs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import minimist from 'minimist';
9-
import { DEFAULT_CONCURRENCY, runCrawler, toArray, isUrlValid } from '@ckeditor/ckeditor5-dev-web-crawler';
9+
import { DEFAULT_CONCURRENCY, DEFAULT_TIMEOUT, runCrawler, toArray, isUrlValid } from '@ckeditor/ckeditor5-dev-web-crawler';
1010

1111
const options = parseArguments( process.argv.slice( 2 ) );
1212

@@ -31,7 +31,8 @@ function parseArguments( args ) {
3131
'url',
3232
'depth',
3333
'exclusions',
34-
'concurrency'
34+
'concurrency',
35+
'timeout'
3536
],
3637

3738
boolean: [
@@ -44,7 +45,8 @@ function parseArguments( args ) {
4445
u: 'url',
4546
d: 'depth',
4647
e: 'exclusions',
47-
c: 'concurrency'
48+
c: 'concurrency',
49+
t: 'timeout'
4850
},
4951

5052
default: {
@@ -63,13 +65,15 @@ function parseArguments( args ) {
6365
'-e', '/ckfinder/',
6466
'-e', '/api/',
6567
'-e', '/assets/',
66-
'-c', DEFAULT_CONCURRENCY
68+
'-c', DEFAULT_CONCURRENCY,
69+
'-t', DEFAULT_TIMEOUT
6770
], config );
6871

6972
const defaultOptionsForManual = minimist( [
7073
'-u', 'http://localhost:8125/',
7174
'-d', 1,
72-
'-c', DEFAULT_CONCURRENCY
75+
'-c', DEFAULT_CONCURRENCY,
76+
'-t', DEFAULT_TIMEOUT * 2
7377
], config );
7478

7579
const options = {};
@@ -94,6 +98,7 @@ function parseArguments( args ) {
9498
url: options.url,
9599
depth: options.depth ? Number( options.depth ) : Infinity,
96100
exclusions: options.exclusions ? toArray( options.exclusions ).filter( exclusion => exclusion.length > 0 ) : [],
101+
timeout: options.timeout ? Number( options.timeout ) : DEFAULT_TIMEOUT,
97102
concurrency: options.concurrency ? Number( options.concurrency ) : 1,
98103
silent: options.silent
99104
};

0 commit comments

Comments
 (0)