Skip to content

Commit

Permalink
Integrate FE circleCI config.yml into BE circleCI config.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
thaigillespie authored and godwinpang committed Mar 13, 2021
1 parent df01a69 commit 14c4741
Showing 1 changed file with 78 additions and 15 deletions.
93 changes: 78 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,56 @@
version: 2.1
orbs:
node: circleci/[email protected]
cypress: cypress-io/[email protected]
jobs:
lint_prettier:
frontend_format:
docker:
- image: circleci/node:12.14.0
steps:
- checkout
- restore_cache:
key: package-cache-{{checksum "frontend/package.json"}}
- run: npm install --prefix frontend
- save_cache:
key: package-cache-{{checksum "frontend/package.json"}}
paths:
- frontend/node_modules
- run:
command: |
npm run --prefix frontend lint
cd frontend; npx prettier --check ./src/**/*.js
frontend_cypress:
executor: cypress/base-12-14-0
steps:
- checkout
- restore_cache:
key: package-cache-{{checksum "frontend/package.json"}}
- run: npm ci --prefix frontend
- save_cache:
key: package-cache-{{checksum "frontend/package.json"}}
paths:
- frontend/node_modules
- run: npm i -g wait-on
- run:
command: npm run --prefix frontend start
background: true
- run: wait-on "${REACT_APP_API_URL}/api/docs"
- run: wait-on http://localhost:3000
- run: npm run --prefix frontend cypress -- --env circle=true

frontend_test:
docker:
- image: circleci/node:12.14.0
steps:
- checkout
- restore_cache:
key: package-cache-{{checksum "frontend/package.json"}}
- run: npm install --prefix frontend
- save_cache:
key: package-cache-{{checksum "frontend/package.json"}}
paths:
- frontend/node_modules
- run: npm run --prefix frontend test
backend_format:
docker:
- image: circleci/node:12.14.0
steps:
Expand All @@ -17,9 +64,9 @@ jobs:
- node_modules
- run:
command: |
npm run lint
npx prettier --check ./src/**/*.js
test:
npm run --prefix backend lint
cd backend; npx prettier --check ./src/**/*.ts
backend_build:
docker:
- image: circleci/node:12.14.0
steps:
Expand All @@ -30,16 +77,32 @@ jobs:
- save_cache:
key: package-cache-{{checksum "package.json"}}
paths:
- node_modules
- run: npm run test
- backend/node_modules
- run: npm run --prefix backend build:no-check
backend_test:
docker:
- image: circleci/node:12.14.0
steps:
- checkout
- restore_cache:
key: package-cache-{{checksum "backend/package.json"}}
- run: npm install --prefix backend
- save_cache:
key: package-cache-{{checksum "backend/package.json"}}
paths:
- backend/node_modules
- run: npm run --prefix backend test

workflows:
lint_and_test:
backend:
jobs:
- backend_format
- backend_build
- backend_test
frontend:
jobs:
- lint_prettier
- cypress/run:
- frontend_format
- frontend_cypress:
requires:
- lint_prettier
executor: cypress/base-12-14-0
start: npm run start
wait-on: 'http://localhost:3000'
- test
- frontend_format
- frontend_test

0 comments on commit 14c4741

Please sign in to comment.