Update circle ci setup
This commit is contained in:
parent
42c7f98a82
commit
62ac5e054e
1 changed files with 26 additions and 52 deletions
|
|
@ -1,51 +1,37 @@
|
|||
version: 2.1
|
||||
|
||||
# Orbs for Node.js support
|
||||
orbs:
|
||||
node: circleci/node@6.1.0
|
||||
|
||||
# Define executor
|
||||
executors:
|
||||
node-executor:
|
||||
docker:
|
||||
- image: cimg/node:20.11
|
||||
- image: node:18
|
||||
resource_class: large
|
||||
working_directory: ~/project
|
||||
|
||||
# Reusable commands
|
||||
commands:
|
||||
setup-pnpm:
|
||||
steps:
|
||||
- run:
|
||||
name: Install pnpm
|
||||
command: |
|
||||
corepack enable
|
||||
corepack prepare pnpm@10.19.0 --activate
|
||||
|
||||
restore-dependencies:
|
||||
steps:
|
||||
- restore_cache:
|
||||
name: Restore pnpm Package Cache
|
||||
|
||||
keys:
|
||||
- pnpm-deps-v1-{{ checksum "pnpm-lock.yaml" }}
|
||||
- pnpm-deps-v1-
|
||||
|
||||
save-dependencies:
|
||||
steps:
|
||||
- save_cache:
|
||||
key: pnpm-deps-v1-{{ checksum "pnpm-lock.yaml" }}
|
||||
paths:
|
||||
- ~/.local/share/pnpm/store
|
||||
- node_modules
|
||||
- apps/main/node_modules
|
||||
- apps/external/node_modules
|
||||
- packages/ui/node_modules
|
||||
- packages/shared/node_modules
|
||||
|
||||
install-deps:
|
||||
steps:
|
||||
- pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: pnpm install --frozen-lockfile
|
||||
name: Install pnpm package manager
|
||||
command: |
|
||||
npm install --global corepack@latest
|
||||
corepack enable
|
||||
corepack prepare pnpm@latest-10 --activate
|
||||
pnpm config set store-dir .pnpm-store
|
||||
- run:
|
||||
name: Install Dependencies
|
||||
command: pnpm install
|
||||
- save_cache:
|
||||
name: Save pnpm Package Cache
|
||||
key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
|
||||
paths:
|
||||
- .pnpm-store
|
||||
|
||||
# Jobs
|
||||
jobs:
|
||||
|
|
@ -58,9 +44,6 @@ jobs:
|
|||
steps:
|
||||
- checkout
|
||||
- setup-pnpm
|
||||
- restore-dependencies
|
||||
- install-deps
|
||||
- save-dependencies
|
||||
- run:
|
||||
name: Run linting
|
||||
command: pnpm run lint
|
||||
|
|
@ -73,8 +56,6 @@ jobs:
|
|||
steps:
|
||||
- checkout
|
||||
- setup-pnpm
|
||||
- restore-dependencies
|
||||
- install-deps
|
||||
- run:
|
||||
name: Type check all packages
|
||||
command: pnpm run typecheck
|
||||
|
|
@ -84,8 +65,6 @@ jobs:
|
|||
steps:
|
||||
- checkout
|
||||
- setup-pnpm
|
||||
- restore-dependencies
|
||||
- install-deps
|
||||
- run:
|
||||
name: Run unit tests
|
||||
command: pnpm run test
|
||||
|
|
@ -99,18 +78,18 @@ jobs:
|
|||
executor: node-executor
|
||||
steps:
|
||||
- checkout
|
||||
- setup-pnpm
|
||||
- restore_cache:
|
||||
name: Restore npm API Cache
|
||||
keys:
|
||||
- npm-api-{{ checksum "api/package-lock.json" }}
|
||||
- run:
|
||||
name: Install API dependencies
|
||||
command: |
|
||||
cd api
|
||||
npm ci
|
||||
- restore_cache:
|
||||
keys:
|
||||
- npm-api-v1-{{ checksum "api/package-lock.json" }}
|
||||
- npm-api-v1-
|
||||
- save_cache:
|
||||
key: npm-api-v1-{{ checksum "api/package-lock.json" }}
|
||||
name: Save npm API Cache
|
||||
key: npm-api-{{ checksum "api/package-lock.json" }}
|
||||
paths:
|
||||
- api/node_modules
|
||||
- run:
|
||||
|
|
@ -133,8 +112,6 @@ jobs:
|
|||
steps:
|
||||
- checkout
|
||||
- setup-pnpm
|
||||
- restore-dependencies
|
||||
- install-deps
|
||||
- run:
|
||||
name: Build all apps
|
||||
command: pnpm run build:apps
|
||||
|
|
@ -157,8 +134,9 @@ jobs:
|
|||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
name: Restore npm API Cache
|
||||
keys:
|
||||
- npm-api-v1-{{ checksum "api/package-lock.json" }}
|
||||
- npm-api-{{ checksum "api/package-lock.json" }}
|
||||
- run:
|
||||
name: Install API dependencies
|
||||
command: |
|
||||
|
|
@ -215,8 +193,6 @@ jobs:
|
|||
- attach_workspace:
|
||||
at: .
|
||||
- setup-pnpm
|
||||
- restore-dependencies
|
||||
- install-deps
|
||||
- run:
|
||||
name: Deploy frontend to staging
|
||||
command: |
|
||||
|
|
@ -240,8 +216,6 @@ jobs:
|
|||
- attach_workspace:
|
||||
at: .
|
||||
- setup-pnpm
|
||||
- restore-dependencies
|
||||
- install-deps
|
||||
- run:
|
||||
name: Deploy frontend to production
|
||||
command: |
|
||||
|
|
|
|||
Loading…
Reference in a new issue