es-toolkit/.circleci/config.yml

102 lines
2.3 KiB
YAML

version: 2.1
parameters:
pull_request:
type: boolean
default: false
orbs:
slack: circleci/slack@4.5.0
commands:
setup:
steps:
- run:
name: Install yarn
command: |
COREPACK_PATH=$HOME/.local/bin
mkdir -p $COREPACK_PATH
eval "$(echo PATH=$COREPACK_PATH:\$PATH | tee -a $BASH_ENV)"
corepack enable --install-directory $COREPACK_PATH
yarn install
jobs:
lint:
docker:
- image: cimg/node:20.12
steps:
- checkout
- setup
- run:
name: ESLint
command: yarn eslint -c .eslintrc.js $(git diff --name-only --diff-filter=ACMRUXB origin/main | grep -E "(.js$|.ts$)")
- run:
name: Prettier
command: modifiedFiles=$(git diff --name-only --diff-filter=ACMRUXB origin/main | grep -E "(.js$|.ts$)") && [ -n "$modifiedFiles" ] && yarn prettier -c $modifiedFiles || echo "No modified files."
typecheck:
docker:
- image: cimg/node:20.12
steps:
- checkout
- setup
- run:
name: Typecheck
command: yarn tsc --noEmit
pre-pack:
docker:
- image: cimg/node:20.12
steps:
- checkout
- setup
- run:
name: Build
command: yarn build
check-peer:
docker:
- image: cimg/node:20.12
steps:
- checkout
- setup
- run:
name: Check Peer Dependency
command: ./.scripts/check-peer.sh || (echo "Peer Dependency 오류가 발생했습니다."; exit -1)
test:
docker:
- image: cimg/node:18.20.4
steps:
- checkout
- setup
- run:
name: vitest
command: yarn vitest --reporter=junit > ./.junit
- store_test_results:
path: ./.junit
- store_artifacts:
path: ./.junit
workflows:
main:
jobs:
- test:
filters:
branches:
ignore: main
- lint:
filters:
branches:
ignore: main
- typecheck:
filters:
branches:
ignore: main
- pre-pack:
filters:
branches:
ignore: main
- check-peer:
filters:
branches:
ignore: main