Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split frontend step into more steps in CircleCi #1574

Open
saraojelind opened this issue Jun 8, 2023 · 0 comments
Open

Split frontend step into more steps in CircleCi #1574

saraojelind opened this issue Jun 8, 2023 · 0 comments

Comments

@saraojelind
Copy link
Member

Split frontend into more steps; npm, test, storybook and frontend. This way the jobs can be run parallell minimizing deploy time and easier to skip storybook on production deployment. Also add npm as dependency for test and storybook, and instead use a seperate npm install for build-command to make sure no dev packages are installed npm ci --omit=dev

frontend:
<<: *defaults
executor: node
environment:
SENTRY_AUTH_TOKEN: ${SENTRY_AUTH_TOKEN}
steps:
- *restore_repo
- restore_cache:
key: v1-npm-{{ checksum "frontend/package.json" }}
- run: cd frontend && npm ci
- save_cache:
key: v1-npm-{{ checksum "frontend/package.json" }}
paths:
- ~/repo/frontend/node_modules
- run:
command: |
mkdir -p test-results/jest
cd frontend
npm run test:ci
echo "NEXT_PUBLIC_SENTRY_DSN=$NEXT_PUBLIC_SENTRY_DSN" >> .env
npm run build
npm run build-storybook
# So we don't copy the gigantic node_modules on each deploy
rm -rf node_modules
environment:
JEST_JUNIT_OUTPUT_DIR: ../test-results/jest/
- store_test_results:
path: test-results/jest
- store_artifacts:
path: test-results/jest
- save_cache:
key: v1-assets-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/repo/frontend/
- when:
condition: ${SLACK_ACCESS_TOKEN}
steps:
- slack/notify:
event: fail
template: basic_fail_1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant