-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate FE circleCI config.yml into BE circleCI config.yml
- Loading branch information
1 parent
df01a69
commit 14c4741
Showing
1 changed file
with
78 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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: | ||
|
@@ -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 |