From fb902fc014ee781ef09588f8ba888278fd2f9294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Tr=C4=99bski?= Date: Sun, 8 Apr 2018 01:23:12 +0200 Subject: [PATCH] Enable CircleCI (#295) * Enable CircleCI * Fix tests --- .circleci/config.yml | 49 ++++++++++++++++++++++++++++++++++ .travis.yml | 48 --------------------------------- package.json | 2 +- src/common/card.tsx | 2 +- src/pages/cv/basics.tsx | 2 +- src/pages/cv/school.tsx | 2 +- src/pages/cv/skills.tsx | 2 +- src/pages/cv/work.tsx | 2 +- src/pages/stats/stats_page.tsx | 2 +- src/router.tsx | 4 +-- src/setupTests.ts | 2 +- 11 files changed, 59 insertions(+), 58 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 00000000..d5f97574 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,49 @@ +version: 2 +jobs: + verify: + docker: + - image: circleci/node:9.11.1 + + working_directory: ~/repo + + steps: + - checkout + + - restore_cache: + keys: + - yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} + - run: yarn install + - save_cache: + paths: + - ~/.cache/yarn + key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} + + - run: yarn lint + - run: yarn test + - run: yarn coverage + build: + docker: + - image: circleci/node:9.11.1 + + working_directory: ~/repo + + steps: + - checkout + + - restore_cache: + keys: + - yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} + - run: yarn install + - save_cache: + paths: + - ~/.cache/yarn + key: yarn-v1-{{ checksum "yarn.lock" }}-{{ arch }} + + - run: yarn build + +workflows: + version: 2 + pipeline: + jobs: + - verify + - build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 192511f8..00000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -dist: trusty -sudo: required - -addons: - apt: - sources: - - google-chrome - packages: - - google-chrome-stable - -cache: yarn - -language: node_js -node_js: - - "node" - -before_install: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - "npm install --global create-react-app" - -jobs: - include: - - stage: verify - script: yarn lint && yarn test && yarn coverage - - stage: build - script: yarn build - - stage: deploy - script: yarn build && tar -zcvf build.tar.gz build - deploy: - - provider: releases - api_key: - secure: SRyCfehjpKZ/K9GtVPgtCIPZxwTvXzI9pwt2HmQxCEJCKBSTOC4VVafS2C5VOPKr+pXf5EWTQsPU/Xd18+dDLrL6GDYUZBKiKXeEHnkdl1vsZ2ngRDjYMODsVs46zJacgFxE9AervRlreyLKf4cZEBVtnQqXaxusJIn6gk/BH8e31hwgoThEeKeA0GYXIAGFpcrHfQLGaqhnyGTbLF2v24Wug9kuRfN3TBbDjNjAcEBOX4DNYrjnbYPf+aZW4tATeWvYKCeDAGZvbebr9tQ9Fx/qKYB0ln5xGrFm0TUcNp4kqEeCZj+iqhLiV25lFo1ZGC9Wl0X6wxWT4AOAdWR47S9gW4HXyahspZA1BzL0864bOB3oFBUSIsms+w8SBGzVrH3BFtEX0QkNtIYLQNoLJ39p1idm4GCaSDuMaBdyrk/Nb9b2g0C1qZ5VlSvIjFfQXsdxOHCYTUdU9TTo3qJDzyLuvMqlXeojwUfyIi5RmPvVHQrS/fXlm8XHxpof7yY2p06oATTue6k10YfDSLonH/YRFmjvC+Zi2U/wSNDs5UA+AjDiPAiN9Y+kQcvqwJK2vZtuU/a9hJ+iMthgd34R7yioC3vFQM3F72sEG40L2A7vqTAtmHyjBu1R4HFBiMLTO2cXDv71jripMJPYecTMYOWhoIfJRKGiVsF8tHawUh4= - file: build.tar.gz - skip_cleanup: true - on: - tags: true - repo: kornicameister/korni - branch: master - - provider: pages - skip_cleanup: true - github_token: - secure: SRyCfehjpKZ/K9GtVPgtCIPZxwTvXzI9pwt2HmQxCEJCKBSTOC4VVafS2C5VOPKr+pXf5EWTQsPU/Xd18+dDLrL6GDYUZBKiKXeEHnkdl1vsZ2ngRDjYMODsVs46zJacgFxE9AervRlreyLKf4cZEBVtnQqXaxusJIn6gk/BH8e31hwgoThEeKeA0GYXIAGFpcrHfQLGaqhnyGTbLF2v24Wug9kuRfN3TBbDjNjAcEBOX4DNYrjnbYPf+aZW4tATeWvYKCeDAGZvbebr9tQ9Fx/qKYB0ln5xGrFm0TUcNp4kqEeCZj+iqhLiV25lFo1ZGC9Wl0X6wxWT4AOAdWR47S9gW4HXyahspZA1BzL0864bOB3oFBUSIsms+w8SBGzVrH3BFtEX0QkNtIYLQNoLJ39p1idm4GCaSDuMaBdyrk/Nb9b2g0C1qZ5VlSvIjFfQXsdxOHCYTUdU9TTo3qJDzyLuvMqlXeojwUfyIi5RmPvVHQrS/fXlm8XHxpof7yY2p06oATTue6k10YfDSLonH/YRFmjvC+Zi2U/wSNDs5UA+AjDiPAiN9Y+kQcvqwJK2vZtuU/a9hJ+iMthgd34R7yioC3vFQM3F72sEG40L2A7vqTAtmHyjBu1R4HFBiMLTO2cXDv71jripMJPYecTMYOWhoIfJRKGiVsF8tHawUh4= - local_dir: build - on: - tags: true - repo: kornicameister/korni - branch: master diff --git a/package.json b/package.json index 54ed4328..c9494403 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "0.2.8", "private": true, "engines": { - "node": "9.9.0" + "node": "9.11.1" }, "lint-staged": { "src/**/*.{ts,tsx}": [ diff --git a/src/common/card.tsx b/src/common/card.tsx index 29270e59..33dfd9bc 100644 --- a/src/common/card.tsx +++ b/src/common/card.tsx @@ -1,4 +1,4 @@ -import * as classnames from 'classnames'; +import classnames from 'classnames'; import * as React from 'react'; interface ClickableCardProps { diff --git a/src/pages/cv/basics.tsx b/src/pages/cv/basics.tsx index a615e318..70312c4b 100644 --- a/src/pages/cv/basics.tsx +++ b/src/pages/cv/basics.tsx @@ -1,4 +1,4 @@ -import * as classnames from 'classnames'; +import classnames from 'classnames'; import * as React from 'react'; const enum Profiles { diff --git a/src/pages/cv/school.tsx b/src/pages/cv/school.tsx index a8cd802f..ff4ba275 100644 --- a/src/pages/cv/school.tsx +++ b/src/pages/cv/school.tsx @@ -1,4 +1,4 @@ -import * as classnames from 'classnames'; +import classnames from 'classnames'; import * as React from 'react'; import './school.css'; diff --git a/src/pages/cv/skills.tsx b/src/pages/cv/skills.tsx index 0b527236..f657cd4b 100644 --- a/src/pages/cv/skills.tsx +++ b/src/pages/cv/skills.tsx @@ -1,4 +1,4 @@ -import * as classnames from 'classnames'; +import classnames from 'classnames'; import * as React from 'react'; import { ClickableCard } from '../../common/card'; diff --git a/src/pages/cv/work.tsx b/src/pages/cv/work.tsx index b0e21ac4..2a34a975 100644 --- a/src/pages/cv/work.tsx +++ b/src/pages/cv/work.tsx @@ -1,4 +1,4 @@ -import * as classnames from 'classnames'; +import classnames from 'classnames'; import * as moment from 'moment'; import * as React from 'react'; diff --git a/src/pages/stats/stats_page.tsx b/src/pages/stats/stats_page.tsx index dc2d82e2..8e625bb6 100644 --- a/src/pages/stats/stats_page.tsx +++ b/src/pages/stats/stats_page.tsx @@ -1,4 +1,4 @@ -import * as classnames from 'classnames'; +import classnames from 'classnames'; import * as React from 'react'; import { LoadableComponent } from 'react-loadable'; import { Container, Nav, NavLink, TabContent, TabPane } from 'reactstrap'; diff --git a/src/router.tsx b/src/router.tsx index 17cc2341..dc94630f 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -1,4 +1,4 @@ -import * as classNames from 'classnames'; +import classnames from 'classnames'; import * as React from 'react'; import { LoadingComponentProps } from 'react-loadable'; import { Container } from 'reactstrap'; @@ -15,7 +15,7 @@ export default class RouteLoader extends React.Component } private renderLoader(): JSX.Element | null { - const classes = classNames('alert', { + const classes = classnames('alert', { 'alert-danger': !this.props.isLoading && this.props.error, 'alert-info': this.props.isLoading && !this.props.timedOut && this.props.pastDelay, 'alert-warning': this.props.isLoading && this.props.timedOut, diff --git a/src/setupTests.ts b/src/setupTests.ts index f96f9e60..de7d4990 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -11,6 +11,6 @@ global.requestAnimationFrame = callback => { // init env import { configure as EnzymeConfigure } from 'enzyme'; -import * as Adapter from 'enzyme-adapter-react-16'; +import Adapter from 'enzyme-adapter-react-16'; EnzymeConfigure({ adapter: new Adapter() });