Skip to content

Split frontend step into more steps in CircleCi #1574

Open
@saraojelind

Description

@saraojelind

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions