Skip to content

Commit

Permalink
Adds CircleCI configuration (#39)
Browse files Browse the repository at this point in the history
* Adds initial circle config file

* Add script to checksum all packages package.json, save cache based on this.

* Use yarn with lerna

* remove --no-ci option

* slightly clarify documentation

* Adds lint step
  • Loading branch information
bg451 authored and mayurkale22 committed Jun 20, 2019
1 parent 802182e commit e712b45
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .circleci/checksum.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#! /bin/sh
#
# Usage: checksum.sh filename
#
# checksum.sh computes the checksum of the repo's top level `package.json`
# and `package.json` files in package/, putting the hashes into a file in
# alphabetical order. Must be run at the top level of the repository.


if [ -z $1 ]; then
echo "Usage: checksum.sh filename"
exit 1
fi

FILE=$1

# remove existing file
if [ -f $FILE ]; then
rm $FILE
fi

openssl md5 package.json >> $FILE

find packages/*/package.json | xargs -I{} openssl md5 {} >> $FILE

sort -o $FILE $FILE
33 changes: 33 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 2

jobs:
build:
docker:
- image: circleci/node:12
steps:
- checkout
- run:
name: Create Checksum
command: sh .circleci/checksum.sh /tmp/checksums.txt
- restore_cache:
keys:
- npm-cache-{{ checksum "/tmp/checksums.txt" }}
- run:
name: Install Dependencies
command: yarn install
- save_cache:
key: npm-cache-{{ checksum "/tmp/checksums.txt" }}
paths:
- ./node_modules
- ./yarn.lock
- ./packages/*/node_modules
- ./packages/*/yarn.lock
- run:
name: Lint
command: yarn run check
- run:
name: Compile
command: yarn run compile
- run:
name: Test
command: yarn run test
1 change: 1 addition & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"lerna": "3.13.4",
"npmClient": "yarn",
"packages": [
"packages/*"
],
Expand Down

0 comments on commit e712b45

Please sign in to comment.