2024-04-25 14:56:13 +03:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
parameters:
|
|
|
|
pull_request:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
|
|
|
|
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:
|
2024-07-19 11:26:51 +03:00
|
|
|
name: ESLint
|
2024-07-23 17:19:10 +03:00
|
|
|
shell: bash -e
|
2024-08-07 12:51:07 +03:00
|
|
|
command: |
|
|
|
|
changed_files=$(git diff --name-only --diff-filter=ACMRUXB origin/main)
|
|
|
|
|
2024-08-20 15:55:39 +03:00
|
|
|
if echo "$changed_files" | grep -q "^eslint.config.mjs$"; then
|
|
|
|
yarn lint
|
2024-08-07 12:51:07 +03:00
|
|
|
else
|
2024-08-20 15:55:39 +03:00
|
|
|
echo "$changed_files" | grep -E "(.js$|.ts$)" | xargs -r yarn lint
|
2024-08-07 12:51:07 +03:00
|
|
|
fi
|
2024-07-19 11:26:51 +03:00
|
|
|
- run:
|
|
|
|
name: Prettier
|
2024-08-07 12:51:07 +03:00
|
|
|
command: |
|
|
|
|
changed_files=$(git diff --name-only --diff-filter=ACMRUXB origin/main)
|
|
|
|
|
|
|
|
if echo "$changed_files" | grep -q -E "^\.prettierrc$|^\.prettierignore$"; then
|
|
|
|
yarn prettier -c .
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "$changed_files" | xargs -r yarn prettier -c --ignore-unknown
|
|
|
|
fi
|
2024-04-25 14:56:13 +03:00
|
|
|
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
|
2024-07-23 17:03:27 +03:00
|
|
|
command: yarn pack --out package.tgz
|
|
|
|
- run:
|
|
|
|
name: Check Dist
|
|
|
|
command: node --test .scripts/check-dist.mjs
|
|
|
|
- run:
|
|
|
|
name: Check Package Types
|
|
|
|
command: yarn attw package.tgz
|
2024-04-25 14:56:13 +03:00
|
|
|
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:
|
2024-07-18 17:03:20 +03:00
|
|
|
- image: cimg/node:18.20.4
|
2024-04-25 14:56:13 +03:00
|
|
|
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:
|
2024-06-04 11:19:26 +03:00
|
|
|
ignore: main
|