콘텐츠로 이동

지속적 통합

지속적 통합(CI) 환경에서 Biome을 실행하는 것은 간단합니다. 아래 예시를 참조하여 영감을 얻으세요.

Biome을 실행 환경에 설정하기 위한 GitHub Action을 제공합니다.
아래는 간단한 워크플로우의 예시입니다:

pull_request.yml
name: 코드 품질
on:
push:
pull_request:
jobs:
quality:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: 체크아웃
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Biome 설정
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Biome 실행
run: biome ci .

다른 커뮤니티에서 유지 관리하는 다음 액션은 당신의 워커에서 사용할 수 있습니다:

  • reviewdog-action-biome: reviewdog와 함께 Biome를 실행하고, 풀 리퀘스트에 주석과 제안 사항을 추가합니다.
pull_request.yml
name: reviewdog
on: [pull_request]
jobs:
biome:
name: 러너 / Biome
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v5
- uses: mongolyy/reviewdog-action-biome@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review

다음은 구성 예시입니다:

.gitlab-ci.yml
# 프로세스 단계 정의
stages:
- quality
# Lint 작업 구성: Biome으로 코드 품질 검사
lint:
image:
name: ghcr.io/biomejs/biome:latest # 최신 Biome Docker 이미지 사용
entrypoint: [""] # GitLab CI에서 이미지가 작동하도록 하기 위해 필요함
stage: quality # 품질 단계에서 실행
script:
- biome ci --reporter=gitlab --colors=off > /tmp/code-quality.json
- cp /tmp/code-quality.json code-quality.json
artifacts:
paths:
- code-quality.json # 코드 품질 보고서를 아티팩트로 수집
rules:
- if: $CI_COMMIT_BRANCH # 브랜치에 대한 커밋일 경우 작업 실행
- if: $CI_MERGE_REQUEST_ID # 병합 요청일 경우 작업 실행