Skip to content

Commit

Permalink
chore: set up CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored and Jack Hsu committed Jun 9, 2020
1 parent e5a0e2e commit 7333233
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 6 deletions.
70 changes: 70 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
orbs:
node: circleci/[email protected]

version: 2.1

commands:
yarn_install:
description: 'Install Dependencies'
steps:
- run: yarn install --frozen-lockfile --non-interactive
- save_cache:
key: yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
restore_yarn_cache:
description: 'Restore Cached Dependencies'
steps:
- restore_cache:
keys:
- yarn-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- yarn-

jobs:
install:
docker:
- image: circleci/node:12-browsers
steps:
- checkout
- restore_yarn_cache
- yarn_install
- persist_to_workspace:
root: ~/project
paths: .
lint-and-test:
docker:
- image: circleci/node:12-browsers
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: Lint
command: yarn lint
- run:
name: Run Unit Tests
command: yarn test
end-to-end-tests:
docker:
- image: circleci/node:12-browsers
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: E2E
command: yarn e2e
no_output_timeout: 30m

workflows:
version: 2.1
default_workflow:
jobs:
- install
- lint-and-test:
requires:
- install
- end-to-end-tests:
requires:
- install
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![CircleCI](https://circleci.com/gh/nrwl/gatsby.svg?style=svg)](https://circleci.com/gh/nrwl/gatsby)

<hr>

# Nx Gatsby Plugin

Gatsby CLI supports the following commands for development:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"scripts": {
"nx": "nx",
"start": "nx serve",
"build": "nx build",
"test": "nx test",
"lint": "nx workspace-lint && nx lint",
"e2e": "nx e2e",
"build": "nx build gatsby-plugin",
"test": "nx run-many --target=test --all --parallel",
"lint": "nx workspace-lint && nx run-many --target=lint --all --parallel",
"e2e": "nx e2e gatsby-plugin-e2e",
"affected:apps": "nx affected:apps",
"affected:libs": "nx affected:libs",
"affected:build": "nx affected:build",
Expand Down
4 changes: 2 additions & 2 deletions workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
},
"gatsby-plugin-e2e": {
"projectType": "application",
"root": "apps\\gatsby-plugin-e2e",
"sourceRoot": "apps\\gatsby-plugin-e2e/src",
"root": "apps/gatsby-plugin-e2e",
"sourceRoot": "apps/gatsby-plugin-e2e/src",
"architect": {
"e2e": {
"builder": "@nrwl/nx-plugin:e2e",
Expand Down

0 comments on commit 7333233

Please sign in to comment.