diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..325d8b2 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,63 @@ +stages: + - quality + - build + - test + +cache: + key: + files: + - pnpm-lock.yaml + paths: + - .pnpm-store + policy: pull-push + +.setup_pnpm: + before_script: + - corepack enable + - corepack prepare pnpm@latest-9 --activate + - pnpm config set store-dir .pnpm-store + - pnpm install --frozen-lockfile + - cp sample.env .env || true + +eslint: + stage: quality + image: node:21 + extends: + - .setup_pnpm + script: + - pnpm lint + cache: + policy: pull + +prettier: + stage: quality + image: node:21 + extends: + - .setup_pnpm + script: + - npx prettier --check . + cache: + policy: pull + +build: + stage: build + image: node:21 + extends: + - .setup_pnpm + script: + - pnpm build + +vitest: + stage: test + image: node:21 + extends: + - .setup_pnpm + script: + - pnpm test + dependencies: + - build + +workflow: + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - if: $CI_PIPELINE_SOURCE == "merge_request_event"