Skip to content

Commit

Permalink
Merge pull request #255 from ckeditor/circleci
Browse files Browse the repository at this point in the history
Replace Travis CI with CircleCI
  • Loading branch information
KarolDawidziuk authored Sep 26, 2023
2 parents 7e97e0e + 9dcc9c7 commit c4528f2
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 46 deletions.
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2.1
orbs:
browser-tools: circleci/[email protected]

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: npm test
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.<String>} args CLI arguments and options.
* @returns {Object} options
Expand Down
12 changes: 6 additions & 6 deletions src/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }`;
Expand Down Expand Up @@ -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 );
}

0 comments on commit c4528f2

Please sign in to comment.