Skip to content
Permalink
Browse files

Update CircleCI workflow (#20)

- Refactor scripts/seedDatabase
- Modify circleCI workflow so it can run tests on pull requests
  • Loading branch information
lukePeavey committed Jan 31, 2020
1 parent 984652a commit 6badc1145d201b37bf82a949ab183143b7d9ce4d
Showing with 445 additions and 80 deletions.
  1. +10 −21 .circleci/config.yml
  2. +244 −0 package-lock.json
  3. +3 −0 package.json
  4. +125 −59 scripts/seedDatabase.js
  5. +63 −0 scripts/utils/Spinner.js
@@ -1,26 +1,20 @@
version: 2.1
orbs:
heroku: circleci/heroku@0.0.8
workflows:
test_and_deploy:
integration_tests:
jobs:
- test
# Master is deployed to the staging app in a Heroku pipeline.
- deploy_staging:
requires:
- test
filters:
branches:
only:
- master

jobs:
test:
docker:
- image: circleci/node:12.5.0
- image: circleci/node:13
- image: circleci/mongo:4.2.2

working_directory: ~/quotable

environment:
MONGODB_URI: mongodb://localhost:27017/test

steps:
- checkout

@@ -40,19 +34,14 @@ jobs:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- run:
name: Seeding database
command: npm run -s database:seed data/sample

- run:
name: Running ESLint
command: npm run lint

- run:
name: Running tests
command: npm run test

# Deploys the branch to the staging app in a Heroku Pipeline
deploy_staging:
executor: heroku/default
steps:
- checkout
- heroku/install
- heroku/deploy-via-git:
app-name: 'quotable-api-staging'

Some generated files are not rendered by default. Learn more.

@@ -49,16 +49,19 @@
},
"devDependencies": {
"babel-eslint": "^10.0.3",
"cli-table3": "^0.5.1",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.1",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3",
"husky": "^2.4.1",
"is-interactive": "^1.0.0",
"jest": "^24.9.0",
"lint-staged": "^8.2.1",
"nodemon": "^1.19.2",
"ora": "^4.0.3",
"prettier": "^1.18.2",
"shelljs": "^0.8.3",
"supertest": "^4.0.2"

0 comments on commit 6badc11

Please sign in to comment.
You can’t perform that action at this time.