From d36267776c3410ed3de0541d066caeb5076003ce Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 16:37:10 +0200 Subject: [PATCH 1/6] Replace Travis CI config with CircleCI one. --- .circleci/config.yml | 25 +++++++++++++++++++++++++ .travis.yml | 38 -------------------------------------- 2 files changed, 25 insertions(+), 38 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..44a7e29 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,25 @@ +version: 2.1 +orbs: + browser-tools: circleci/browser-tools@1.4.6 + +workflows: + test: + jobs: + - test + +jobs: + test: + docker: + - image: cimg/node:12.22.11-browsers + steps: + - browser-tools/install-browser-tools + - checkout + - run: + name: Install npm + command: npm install --prefix=$HOME/.local install npm@7 -g + - run: + name: Install dependencies + command: npm install + - run: + name: Run tests + command: ng test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9d65e01..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -os: linux -dist: xenial - -services: - - xvfb - -addons: - firefox: latest - -branches: - only: - - master - - major - - stable - - latest - - /^\d+\.\d+(\.\d+)?(-\S*)?$/ - - /^release\/\d+\.\d+\.x$/ - -language: node_js -node_js: - - 12 - -cache: - npm: false - -before_install: - - 'export DISPLAY=:99.0' - - npm install npm@7 -g - - npm --version -install: - - npm install -script: - - ng test -env: - global: - - secure: nbn1MJ/N+shUkYqXqKxzQJw30F8q7XC4LNxuMYuP13deUI1/XzRWh7l6+T37AVQicDoVXbro2ve5hknc5TtGwGJTZnvZRtnGe/vZigj/N/NGYeuiNSNIzNQ9MyqJ0sxvuPEIDhYn5UfXkpweoYFe4Budy4AWvHbeE8KNLfzs4M+YD/Oyi+dyBY+RvWWHYRgfbrc7ZiDoRcx2ZDeYPjs5gWDK0VfG13IIp3YnZIpL8CWjI0+p1BBzTP9eQxtRcumLlxq1Rm7sqtxyyRaFTL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A9FJaCmAEZtU6GJ1in9DjDeSw= - - secure: "Bm/gL4RFkV9DIpofb2v6Arao8bH21FsVeapb8OyLmFCjW2bmESJ0+5UNfa/pQYthskLHigKSqN1SgKoFQ+Vab5bV/1k0+oepSLz0Q4QibfZOeGCBiG9UeBxU7+2e0Z+QGGjbbv9iLXhlXss8tWhdQTU7Rz55z52Lc5y8M6/nxNyVRavXQezn4KTKZA+k9CE2s9ETbPUN1HmY60TxSdPnZr65KAfHJVFtRyZjOBU8gKwbO8o8ye9EE6KS0eg/YDGtIXYI9A5NDnKCjF+vtE113cGI9f2Bxxci3Us123LeEm2PFd20u0xCeTDpizWPvinQC6dItsnwaYmGaXCU36gjfdegagOO3JYblHlQvUlzHFHiQPKMyjBwiMC1pPZzJZ5c96dr0kc6RPgv3mR1bielQ3pHxRNrip6KLWn8zVlULYBuW7JERo1golrCzaFxFnW6bnwnJzvpZzLar9fCEAgRwqA2OVi4u9na0pogd0XDMNphfmZs/XnXlkGni96dxYjqXXIA1mgKFz5w/I0DNUo3U0K02ptcJ7bm983KZbl8q8k1kTd4hWjCvdWTSy6Q2zrD8plCZTjUHm19fvrtPo2p/M/xa93H20QBMLPSpjYqSYyGbGX0OlM0k/VGFpg8aSaP3QRVuQibwMVs8PjRjozTA9myBe8YgAcKwzW/Jj1OrSs=" From a3885a51985cb500103cd7a124aae5e627b02de9 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 16:37:22 +0200 Subject: [PATCH 2/6] Replace env variables. --- src/karma.conf.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/karma.conf.js b/src/karma.conf.js index 490726f..b7a4301 100644 --- a/src/karma.conf.js +++ b/src/karma.conf.js @@ -75,17 +75,17 @@ module.exports = function ( config ) { }; // Formats name of the build for BrowserStack. It merges a repository name and current timestamp. -// If env variable `TRAVIS_REPO_SLUG` is not available, the function returns `undefined`. +// If env variable `CIRCLE_PROJECT_REPONAME` is not available, the function returns `undefined`. // // @returns {String|undefined} function getBuildName() { - const repoSlug = process.env.TRAVIS_REPO_SLUG; + const repoName = process.env.CIRCLE_PROJECT_REPONAME; - if ( !repoSlug ) { + if ( !repoName ) { return; } - const repositoryName = repoSlug.split( '/' )[ 1 ].replace( /-/g, '_' ); + const repositoryName = repoName.replace( /-/g, '_' ); const date = new Date().getTime(); return `${ repositoryName } ${ date }`; @@ -136,7 +136,7 @@ function shouldEnableBrowserStack() { return false; } - // If the repository slugs are different, the pull request comes from the community (forked repository). + // If the CIRCLE_PR_REPONAME variable is set, it indicates that the PR comes from the forked repo. // For such builds, BrowserStack will be disabled. Read more: https://github.com/ckeditor/ckeditor5-dev/issues/358. - return ( process.env.TRAVIS_EVENT_TYPE !== 'pull_request' || process.env.TRAVIS_PULL_REQUEST_SLUG === process.env.TRAVIS_REPO_SLUG ); + return ( 'CIRCLE_PR_REPONAME' in process.env && process.env.CIRCLE_PR_REPONAME !== '' ); } From d6ed7e876bc252e62ce697c46e97fe9dc4608c1c Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 16:37:41 +0200 Subject: [PATCH 3/6] Update badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f1ae9e..4c9b0ac 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![npm version](https://badge.fury.io/js/ckeditor4-angular.svg)](https://www.npmjs.com/package/ckeditor4-angular) [![GitHub tag](https://img.shields.io/github/tag/ckeditor/ckeditor4-angular.svg)](https://github.com/ckeditor/ckeditor4-angular) -[![Build Status](https://app.travis-ci.com/ckeditor/ckeditor4-angular.svg?branch=master)](https://app.travis-ci.com/ckeditor/ckeditor4-angular) +[![CircleCI](https://dl.circleci.com/status-badge/img/gh/ckeditor/ckeditor4-angular/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/ckeditor/ckeditor4-angular/tree/master) [![Join newsletter](https://img.shields.io/badge/join-newsletter-00cc99.svg)](http://eepurl.com/c3zRPr) [![Follow Twitter](https://img.shields.io/badge/follow-twitter-00cc99.svg)](https://twitter.com/ckeditor) From 88b9f937f89cd02c280998b620959ee98b5d6f51 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 16:40:11 +0200 Subject: [PATCH 4/6] Update test command. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 44a7e29..70366e8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,4 +22,4 @@ jobs: command: npm install - run: name: Run tests - command: ng test + command: npm test From b0e67cb6be95cb5e5793816f5c5bc8df746e5918 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 16:47:26 +0200 Subject: [PATCH 5/6] Update exit code in test script. --- scripts/test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/test.js b/scripts/test.js index 04c4e10..5728694 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -17,11 +17,15 @@ const env = Object.create( process.env ); env.KARMA_OPTIONS = JSON.stringify( options ); -spawn( 'ng', [ 'test' ], { +const testProcess = spawn( 'ng', [ 'test' ], { stdio: 'inherit', // Pass parent's stdio's to child. Without that option no logs will be visible. env } ); +testProcess.on( 'close', ( code ) => { + process.exitCode = code; +} ); + /** * @param {Array.} args CLI arguments and options. * @returns {Object} options From 9dcc9c7bdd65e29a16549990d41249badf0641c2 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 17:01:21 +0200 Subject: [PATCH 6/6] Fix incorrect BS check. --- src/karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/karma.conf.js b/src/karma.conf.js index b7a4301..3c9f732 100644 --- a/src/karma.conf.js +++ b/src/karma.conf.js @@ -138,5 +138,5 @@ function shouldEnableBrowserStack() { // If the CIRCLE_PR_REPONAME variable is set, it indicates that the PR comes from the forked repo. // For such builds, BrowserStack will be disabled. Read more: https://github.com/ckeditor/ckeditor5-dev/issues/358. - return ( 'CIRCLE_PR_REPONAME' in process.env && process.env.CIRCLE_PR_REPONAME !== '' ); + return !( 'CIRCLE_PR_REPONAME' in process.env ); }