Перейти до вмісту
You are currently reading docs for v1.x. Go to the latest docs if you are using newer version.

Continuous Integration

Цей контент ще не доступний вашою мовою.

Running Biome in a CI environment is easy. Check out the following examples for some inspiration.

We provide a first-party GitHub Action to setup Biome in your runner. Here’s what a simple workflow might look like:

pull_request.yml
name: Code quality
on:
push:
pull_request:
jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci .

These are actions maintained by other communities, that you use in your runner:

  • reviewdog-action-biome: run Biome with reviewdog and make comments and commit suggestions on the pull request.
pull_request.yml
name: reviewdog
on: [pull_request]
jobs:
biome:
name: runner / Biome
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: mongolyy/reviewdog-action-biome@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review

Below is an example configuration:

.gitlab-ci.yml
# Define pipeline stages
stages:
- quality
# Lint job configuration: runs code quality checks using Biome
lint:
image:
name: ghcr.io/biomejs/biome:latest # Use the latest Biome Docker image
entrypoint: [""] # This is required for the image to work in GitLab CI
stage: quality # Run in the quality stage
script:
- biome ci --reporter=gitlab --colors=off > /tmp/code-quality.json
- cp /tmp/code-quality.json code-quality.json
artifacts:
paths:
- code-quality.json # Collect the code quality report as an artifact
rules:
- if: $CI_COMMIT_BRANCH # Run job for commits on branches
- if: $CI_MERGE_REQUEST_ID # Run job for merge requests