fix circleci (first try?)

This commit is contained in:
2023-07-29 13:12:09 +02:00
parent faa0aa62c8
commit f16720f13e

View File

@@ -11,38 +11,40 @@ jobs:
MYSQL_PASSWORD: photos MYSQL_PASSWORD: photos
MYSQL_HOST: "localhost" MYSQL_HOST: "localhost"
working_directory: ~/photos/backend working_directory: ~/photos
steps: steps:
# The checkout is INTO the working directory!!!
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
- backend-dependencies-{{ checksum "package.json" }} - backend-dependencies-{{ checksum "backend/package.json" }}
- run: - run:
name: install backend deps name: install backend deps
command: npm i command: cd backend && npm i
- save_cache: - save_cache:
paths: paths:
- node_modules - backend/node_modules
key: backend-dependencies-{{ checksum "package.json" }} key: backend-dependencies-{{ checksum "backend/package.json" }}
- run: - run:
name: test backend name: test backend
command: npm test command: cd backend && npm test
- store_test_results: - store_test_results:
path: backend-report.xml path: ~/photos/backend/backend-report.xml
test-frontend: test-frontend:
docker: docker:
- image: cimg/node:14.20 - image: cimg/node:14.20
working_directory: ~/photos/frontend working_directory: ~/photos
steps: steps:
# The checkout is INTO the working directory!!!
- checkout - checkout
- restore_cache: - restore_cache:
keys: keys:
@@ -50,16 +52,16 @@ jobs:
- run: - run:
name: install frontend deps name: install frontend deps
command: npm i command: cd frontend && npm i
- save_cache: - save_cache:
paths: paths:
- node_modules - frontend/node_modules
key: frontend-dependencies-{{ checksum "frontend/package.json" }} key: frontend-dependencies-{{ checksum "frontend/package.json" }}
- run: - run:
name: test frontend name: test frontend
command: npm test command: cd frontend && npm test
- store_test_results: - store_test_results:
path: ~/photos/frontend/frontend-reports/frontend-report.xml path: ~/photos/frontend/frontend-reports/frontend-report.xml
@@ -68,9 +70,10 @@ jobs:
docker: docker:
- image: cimg/node:14.20 - image: cimg/node:14.20
working_directory: ~/photos/frontend working_directory: ~/photos
steps: steps:
# The checkout is INTO the working directory!!!
- checkout: - checkout:
- restore_cache: - restore_cache:
@@ -79,16 +82,16 @@ jobs:
- run: - run:
name: install frontend deps name: install frontend deps
command: npm i command: cd frontend && npm i
- save_cache: - save_cache:
paths: paths:
- node_modules - frontend/node_modules
key: frontend-dependencies-{{ checksum "frontend/package.json" }} key: frontend-dependencies-{{ checksum "frontend/package.json" }}
- run: - run:
name: build frontend name: build frontend
command: npm run build command: cd frontend && npm run build
build: build:
machine: machine:
image: ubuntu-2004:current image: ubuntu-2004:current
@@ -96,6 +99,7 @@ jobs:
resource_class: large resource_class: large
steps: steps:
# The checkout is INTO the working directory!!!
- checkout - checkout
- run: - run:
name: log in to docker hub name: log in to docker hub