Continuous Integration
Ce contenu n’est pas encore disponible dans votre langue.
Running Biome in a CI environment is easy. Check out the following examples for some inspiration.
GitHub Actions
Section titled GitHub ActionsWe provide a first-party GitHub Action to setup Biome in your runner. Here’s what a simple workflow might look like:
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 .
Third-party actions
Section titled Third-party actionsThese 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.
name: reviewdogon: [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
GitLab CI
Section titled GitLab CIBelow is an example configuration:
# Define pipeline stagesstages: - quality
# Lint job configuration: runs code quality checks using Biomelint: 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