diff --git a/.circleci/config.yml b/.circleci/config.yml index e35484fb960..fb73cea88a5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,7 +38,8 @@ commands: jobs: generate_configuration: - machine: true + docker: + - image: cimg/node:22.12.0 resource_class: medium parameters: isNightly: diff --git a/.circleci/template.yml b/.circleci/template.yml index 903faa19f6c..ee49c7d1ef1 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -4,6 +4,9 @@ # To modify commands to execute on CI review this file, and the script that generates it. version: 2.1 +orbs: + browser-tools: circleci/browser-tools@2.1.2 + # List of parameters must be synchronized between configuration files. parameters: isNightly: @@ -40,14 +43,6 @@ commands: circleci step halt fi - prepare_environment_command: - description: "Prepare environment (RAM, browsers, hosts, etc.)" - steps: - # CircleCI does not use the latest Chrome. Hence, we must install it manually. - - run: - name: Install the latest Chrome - command: yarn ckeditor5-dev-ci-install-latest-chrome - install_ssh_keys_command: description: "Install SSH keys" steps: @@ -67,9 +62,14 @@ commands: checkout_command: description: "Clone the CKEditor 5 repository with limited depth and branches" steps: + - run: + name: Add GitHub to known_hosts + command: | + mkdir -p ~/.ssh + ssh-keyscan github.com >> ~/.ssh/known_hosts - run: name: Checkout code (single branch) - command: git clone --single-branch --depth 10 --branch "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" . + command: git clone --single-branch --depth 1 --branch "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL" . # In the PRs that come from forked repositories, we do not share secret variables. # Hence, some of the scripts will not be executed. See: https://github.com/ckeditor/ckeditor5/issues/7745. @@ -101,13 +101,14 @@ commands: jobs: cke5_manual: - machine: true + docker: + - image: cimg/node:22.12.0-browsers resource_class: large steps: - checkout_command - halt_if_short_flow - bootstrap_repository_command - - prepare_environment_command + - browser-tools/install_chrome - install_newest_emoji - run: name: Prepare DLL builds in CKEditor 5 @@ -117,12 +118,12 @@ jobs: command: bash scripts/check-manual-tests.sh -r ckeditor5 -f ckeditor5 cke5_validators: - machine: true + docker: + - image: cimg/node:22.12.0 resource_class: medium steps: - checkout_command - bootstrap_repository_command - - prepare_environment_command - run: when: always name: Validate versions of CKEditor 5 dependencies @@ -161,14 +162,14 @@ jobs: command: yarn run validate-module-re-exports cke5_coverage: - machine: true + docker: + - image: cimg/node:22.12.0 resource_class: medium steps: - community_verification_command - checkout_command - halt_if_short_flow - bootstrap_repository_command - - prepare_environment_command - attach_workspace: at: .out - run: @@ -185,7 +186,8 @@ jobs: command: npx coveralls -v < .out/combined_lcov.info cke5_trigger_release_process: - machine: true + docker: + - image: cimg/node:22.12.0 resource_class: medium steps: - community_verification_command @@ -213,7 +215,8 @@ jobs: command: yarn ckeditor5-dev-ci-trigger-circle-build cke5_trigger_uber_ci: - machine: true + docker: + - image: cimg/node:22.12.0 resource_class: medium steps: - community_verification_command @@ -224,13 +227,13 @@ jobs: command: yarn ckeditor5-dev-ci-trigger-circle-build release_prepare: - machine: true + docker: + - image: cimg/node:22.12.0 resource_class: large steps: - checkout_command - halt_if_short_flow - bootstrap_repository_command - - prepare_environment_command - run: name: Check if packages are ready to be released command: npm run release:prepare-packages -- --compile-only --verbose @@ -242,7 +245,8 @@ jobs: command: yarn run check-dependencies notify_ci_failure: - machine: true + docker: + - image: cimg/node:22.12.0 resource_class: medium parameters: hideAuthor: @@ -261,7 +265,8 @@ jobs: no_output_timeout: 2h stale_bot: - machine: true + docker: + - image: cimg/node:22.12.0 resource_class: medium steps: - checkout_command diff --git a/scripts/ci/check-unit-tests-for-package.mjs b/scripts/ci/check-unit-tests-for-package.mjs index 0a814689fa3..ab929bc1e69 100644 --- a/scripts/ci/check-unit-tests-for-package.mjs +++ b/scripts/ci/check-unit-tests-for-package.mjs @@ -54,6 +54,7 @@ function runTests( { packageName, checkCoverage, attempts = 3 } ) { 'test', '--reporter=dots', '--production', + '-b ChromeHeadless', `-f ${ shortName }`, checkCoverage ? '--coverage' : null ].filter( Boolean ); diff --git a/scripts/ci/generate-circleci-configuration.mjs b/scripts/ci/generate-circleci-configuration.mjs index ccd1ab5ce77..6f6d86c732e 100755 --- a/scripts/ci/generate-circleci-configuration.mjs +++ b/scripts/ci/generate-circleci-configuration.mjs @@ -42,7 +42,7 @@ const bootstrapCommands = () => ( [ 'checkout_command', 'halt_if_short_flow', 'bootstrap_repository_command', - 'prepare_environment_command' + 'browser-tools/install_chrome' ] ); const prepareCodeCoverageDirectories = () => ( { @@ -120,7 +120,9 @@ const persistToWorkspace = fileName => ( { } ); config.jobs.cke5_tests_framework = { - machine: true, + docker: [ + { image: 'cimg/node:22.12.0-browsers' } + ], steps: [ ...bootstrapCommands(), prepareCodeCoverageDirectories(), @@ -136,7 +138,9 @@ const persistToWorkspace = fileName => ( { // Adding batches to the root `jobs`. featureTestBatches.forEach( ( batch, batchIndex ) => { config.jobs[ featureTestBatchNames[ batchIndex ] ] = { - machine: true, + docker: [ + { image: 'cimg/node:22.12.0-browsers' } + ], steps: [ ...bootstrapCommands(), 'install_newest_emoji', diff --git a/scripts/web-crawler/index.mjs b/scripts/web-crawler/index.mjs index cb0a13d1cec..8c3ba0d8632 100644 --- a/scripts/web-crawler/index.mjs +++ b/scripts/web-crawler/index.mjs @@ -6,7 +6,7 @@ */ import minimist from 'minimist'; -import { DEFAULT_CONCURRENCY, runCrawler, toArray, isUrlValid } from '@ckeditor/ckeditor5-dev-web-crawler'; +import { DEFAULT_CONCURRENCY, DEFAULT_TIMEOUT, runCrawler, toArray, isUrlValid } from '@ckeditor/ckeditor5-dev-web-crawler'; const options = parseArguments( process.argv.slice( 2 ) ); @@ -31,7 +31,8 @@ function parseArguments( args ) { 'url', 'depth', 'exclusions', - 'concurrency' + 'concurrency', + 'timeout' ], boolean: [ @@ -44,7 +45,8 @@ function parseArguments( args ) { u: 'url', d: 'depth', e: 'exclusions', - c: 'concurrency' + c: 'concurrency', + t: 'timeout' }, default: { @@ -63,13 +65,15 @@ function parseArguments( args ) { '-e', '/ckfinder/', '-e', '/api/', '-e', '/assets/', - '-c', DEFAULT_CONCURRENCY + '-c', DEFAULT_CONCURRENCY, + '-t', DEFAULT_TIMEOUT ], config ); const defaultOptionsForManual = minimist( [ '-u', 'http://localhost:8125/', '-d', 1, - '-c', DEFAULT_CONCURRENCY + '-c', DEFAULT_CONCURRENCY, + '-t', DEFAULT_TIMEOUT * 2 ], config ); const options = {}; @@ -94,6 +98,7 @@ function parseArguments( args ) { url: options.url, depth: options.depth ? Number( options.depth ) : Infinity, exclusions: options.exclusions ? toArray( options.exclusions ).filter( exclusion => exclusion.length > 0 ) : [], + timeout: options.timeout ? Number( options.timeout ) : DEFAULT_TIMEOUT, concurrency: options.concurrency ? Number( options.concurrency ) : 1, silent: options.silent };