Skip to content

Commit

Permalink
Add basic CircleCI config
Browse files Browse the repository at this point in the history
  • Loading branch information
whymarrh committed Jan 21, 2020
1 parent 8eb1242 commit d9e3ed1
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: 2.1

workflows:
lint:
jobs:
- prep-deps
- test-lint:
requires:
- prep-deps
- test-unit:
requires:
- prep-deps
- all-tests-pass:
requires:
- test-lint
- test-unit

jobs:
prep-deps:
docker:
- image: circleci/node:10
steps:
- checkout
- run:
name: Install deps
command: |
.circleci/scripts/deps-install.sh
- run:
name: Collect yarn install HAR logs
command: |
.circleci/scripts/collect-har-artifact.sh
- persist_to_workspace:
root: .
paths:
- node_modules
- build-artifacts

test-lint:
docker:
- image: circleci/node:10
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Lint
command: yarn lint

test-unit:
docker:
- image: circleci/node:10
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Unit tests
command: yarn test

all-tests-pass:
docker:
- image: circleci/node:10
steps:
- run:
name: All tests passed
command: echo 'Great success'
9 changes: 9 additions & 0 deletions .circleci/scripts/collect-har-artifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -x
set -e
set -u
set -o pipefail

mkdir -p build-artifacts/yarn-install-har
mv ./*.har build-artifacts/yarn-install-har/
8 changes: 8 additions & 0 deletions .circleci/scripts/deps-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -x
set -e
set -u
set -o pipefail

yarn --frozen-lockfile --ignore-scripts --har

0 comments on commit d9e3ed1

Please sign in to comment.