From 5b946ca286021e5a984302b67055e4401ac8df1d Mon Sep 17 00:00:00 2001 From: Daniel Fjeldstad <45217974+w3bdesign@users.noreply.github.com> Date: Sun, 9 Jun 2024 02:32:13 +0200 Subject: [PATCH] Create config.yml --- .circleci/config.yml | 79 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..913c8496 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,79 @@ +version: 2.1 +orbs: + cypress: cypress-io/cypress@3.3.1 + codecov: codecov/codecov@4.1.0 +executors: + with-chrome-and-firefox: + docker: + - image: "cypress/browsers:node16.14.2-slim-chrome100-ff99-edge" + resource_class: large +jobs: + chromatic-deployment: + docker: + - image: cimg/node:21.7.3 + working_directory: ~/chromatic + steps: + - checkout + - restore_cache: + keys: + - pnpm-packages-v1-{{ checksum "pnpm-lock.yaml" }} + - pnpm-packages-cache-v1 + - run: + name: Install pnpm package manager + command: | + sudo corepack enable + sudo corepack prepare pnpm@latest-8 --activate + - run: + name: Install Dependencies + command: pnpm install --frozen-lockfile + - run: pnpm run chromatic -- --project-token=${CHROMATIC_PROJECT_TOKEN} + - save_cache: + key: pnpm-packages-v1-{{ checksum "pnpm-lock.yaml" }} + paths: + - ~/.pnpm-store + build: + working_directory: /home/circleci/dfweb + docker: + - image: cimg/node:21.7.3-browsers + steps: + - checkout + - restore_cache: + key: pnpm-cache-v2-{{ checksum "pnpm-lock.yaml" }} + - run: + name: Install pnpm package manager + command: | + sudo corepack enable + sudo corepack prepare pnpm@latest-8 --activate + - run: + name: Install Dependencies + command: pnpm install --no-frozen-lockfile + - run: + name: Chrome key start setup + command: sudo apt update -y + - run: + name: Chrome key finish setup + command: wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + - run: + name: Chrome package download + command: sudo apt install ./google-chrome-stable_current_amd64.deb + - save_cache: + key: pnpm-cache-v2-{{ checksum "pnpm-lock.yaml" }} + paths: + - ~/.pnpm-store + - store_artifacts: + path: /root/.npm/_logs + - run: + name: Run Jest Tests + command: pnpm test + - codecov/upload + parallelism: 6 +workflows: + chromatic-deploy: + jobs: + - build: + name: Build Next.js project + #- cypress/run: + #name: Run Cypress E2E tests with Electron + #cypress-command: npx cypress run --browser electron + #start-command: pnpm run dev + #parallelism: 8