From 392af1c6a859a7bcdcc08d9e498f2710017050ab Mon Sep 17 00:00:00 2001 From: Rakan Nimer Date: Tue, 27 Aug 2019 11:20:40 +0300 Subject: [PATCH] ci(docz): add circleci tests (#1027) * fix(gatsby-theme-docz): fix minor linting issue * feat(docz): add circleci * chore(docz): add bootstrap to ci * ci(docz): clear cache * ci(docz): add build step to install * ci(docz): build only * ci(docz-core): try without build * ci(docz-core): remove __tests__ from include * ci(docz-core): add build * ci(docz-core): back to packages --- .circleci/config.yml | 35 +++++++++++++++++++ core/docz-core/tsconfig.json | 2 +- .../src/components/NavLink/index.js | 1 - package.json | 1 + 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..8c21e9902 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,35 @@ +# Javascript Node CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-javascript/ for more details +# +version: 2 +jobs: + build: + docker: + - image: circleci/node:8.12 + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/mongo:3.4.4 + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v4-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v4-dependencies- + + - run: yarn install && yarn bs && yarn packages + + - save_cache: + paths: + - node_modules + key: v3-dependencies-{{ checksum "package.json" }} + + # run tests! + - run: yarn ci diff --git a/core/docz-core/tsconfig.json b/core/docz-core/tsconfig.json index 7df42a03a..11b4c4e56 100644 --- a/core/docz-core/tsconfig.json +++ b/core/docz-core/tsconfig.json @@ -8,6 +8,6 @@ "types": ["node"], "typeRoots": ["../../node_modules/@types", "node_modules/@types"] }, - "include": ["src/**/*", "src/types.d.ts", "__tests__"], + "include": ["src/**/*", "src/types.d.ts"], "exclude": ["node_modules/**"] } diff --git a/core/gatsby-theme-docz/src/components/NavLink/index.js b/core/gatsby-theme-docz/src/components/NavLink/index.js index ec40cb682..5d29a6d17 100644 --- a/core/gatsby-theme-docz/src/components/NavLink/index.js +++ b/core/gatsby-theme-docz/src/components/NavLink/index.js @@ -1,5 +1,4 @@ /** @jsx jsx */ -import React from 'react' import { jsx } from 'theme-ui' import { Link } from 'gatsby' import { useDocs, useCurrentDoc } from 'docz' diff --git a/package.json b/package.json index e6c3b1587..1abd56c7b 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "url": "https://github.com/pedronauck/docz.git" }, "scripts": { + "ci": "npm run packages:lint && npm run packages:test", "clean": "lerna clean", "bs": "lerna bootstrap", "packages": "run-s packages:*",