Skip to content

Commit

Permalink
Merge pull request #178 from ckeditor/i/177
Browse files Browse the repository at this point in the history
Internal: Migrate CI from Travis to Circle. Closes #177.
  • Loading branch information
pomek authored Aug 29, 2023
2 parents 3bdb8fb + 760dcb7 commit 912246d
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 31 deletions.
109 changes: 109 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
version: 2.1

parameters:
isNightly:
type: boolean
default: false

commands:
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

bootstrap_repository_command:
description: "Bootstrap the repository"
steps:
- install_ssh_keys_command
- run:
name: Install dependencies
command: yarn install

install_ssh_keys_command:
description: "Install SSH keys"
steps:
- add_ssh_keys:
fingerprints:
- "2a:97:94:d9:ae:a0:8d:bd:c2:2a:2d:cf:8d:d1:94:bd"

community_verification_command:
description: "👤 Verify if the build was triggered by community - Check if the build should continue"
steps:
- run:
name: 👤 Verify if the build was triggered by community - Check if the build should continue
command: |
#!/bin/bash
if [[ -z ${COVERALLS_REPO_TOKEN} ]];
then
circleci-agent step halt
fi
jobs:
notify_ci_failure:
machine: true
parameters:
hideAuthor:
type: string
default: "false"
steps:
- checkout
- bootstrap_repository_command
- community_verification_command
- run:
environment:
CKE5_SLACK_NOTIFY_HIDE_AUTHOR: << parameters.hideAuthor >>
CKE5_PIPELINE_NUMBER: << pipeline.number >>
name: Waiting for other jobs to finish and sending notification on failure
command: yarn ckeditor5-dev-ci-circle-workflow-notifier
no_output_timeout: 1h

main:
machine: true
steps:
- checkout
- bootstrap_repository_command
- prepare_environment_command
- run:
name: Execute ESLint
command: yarn run lint
- run:
name: Check coverage
command: yarn run test --coverage
- run:
name: Run tests on Firefox
command: yarn run test --browsers=Firefox
- unless:
# Upload the code coverage results for non-nightly builds only.
condition: << pipeline.parameters.isNightly >>
steps:
- community_verification_command
- run:
name: Upload code coverage
command: cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

workflows:
version: 2
main:
unless: << pipeline.parameters.isNightly >>
jobs:
- main
- notify_ci_failure:
filters:
branches:
only:
- master

nightly:
when: << pipeline.parameters.isNightly >>
jobs:
- main
- notify_ci_failure:
hideAuthor: "true"
filters:
branches:
only:
- master
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ CKEditor 5 inspector
=====================================

[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-inspector.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-inspector)
[![Build Status](https://travis-ci.org/ckeditor/ckeditor5-inspector.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5-inspector)
[![CircleCI](https://circleci.com/gh/ckeditor/ckeditor5-inspector.svg?style=shield)](https://app.circleci.com/pipelines/github/ckeditor/ckeditor5-inspector?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5-inspector/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5-inspector?branch=master)
![Dependency Status](https://img.shields.io/librariesio/release/npm/@ckeditor/ckeditor5-inspector)

The official [CKEditor 5](https://ckeditor.com/ckeditor-5) rich text editor instance inspector for developers.

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"license": "GPL-2.0-or-later",
"version": "4.1.0",
"engines": {
"node": ">=16.0.0",
"npm": ">=5.7.1"
"node": ">=16.0.0"
},
"scripts": {
"postinstall": "node ./scripts/postinstall.js",
Expand Down Expand Up @@ -41,7 +40,7 @@
"@ckeditor/ckeditor5-basic-styles": "^35.0.0",
"@ckeditor/ckeditor5-block-quote": "^35.0.0",
"@ckeditor/ckeditor5-dev-bump-year": "^38.0.0",
"@ckeditor/ckeditor5-dev-ci": "^38.0.0",
"@ckeditor/ckeditor5-dev-ci": "^38.4.0",
"@ckeditor/ckeditor5-dev-release-tools": "^38.0.0",
"@ckeditor/ckeditor5-dev-utils": "^38.0.0",
"@ckeditor/ckeditor5-editor-decoupled": "^35.0.0",
Expand Down
9 changes: 7 additions & 2 deletions scripts/utils/getkarmaconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = function getKarmaConfig() {
browsers: getBrowsers( options.browsers ),

customLaunchers: {
CHROME_TRAVIS_CI: {
CHROME_CI: {
base: 'Chrome',
flags: [ '--no-sandbox', '--disable-background-timer-throttling' ]
},
Expand Down Expand Up @@ -98,6 +98,11 @@ module.exports = function getKarmaConfig() {
type: 'lcovonly',
dir: coverageDir,
subdir: '.'
},
{
type: 'json',
dir: coverageDir,
subdir: '.'
}
]
};
Expand Down Expand Up @@ -141,7 +146,7 @@ function getBrowsers( browsers ) {
return browser;
}

return process.env.TRAVIS ? 'CHROME_TRAVIS_CI' : 'CHROME_LOCAL';
return process.env.CI ? 'CHROME_CI' : 'CHROME_LOCAL';
} );
}

Expand Down

0 comments on commit 912246d

Please sign in to comment.