Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add GitLab CI configuration example to continuous integration g… #1731

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

coka-stefan
Copy link

Summary

Added example for usage in GitLab CI pipelines

Copy link

netlify bot commented Feb 10, 2025

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit a87d005
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/67aa2f428db8590008d894ef
😎 Deploy Preview https://deploy-preview-1731--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nhedger
Copy link
Member

nhedger commented Feb 10, 2025

We actually ship Docker images for Biome which can be used in GitLab CI. Maybe the example could use them instead. Save the user from installing Biome in a node image.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. @nhedger please check the docker side and merge it whenever you see fit :)

entrypoint: [""] # This is required for the image to work in GitLab CI
stage: quality # Run in the quality stage
script:
- biome ci src --reporter=gitlab --colors=off --log-level=none --diagnostic-level=error > code-quality.json # Execute Biome on the 'src' directory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- biome ci src --reporter=gitlab --colors=off --log-level=none --diagnostic-level=error > code-quality.json # Execute Biome on the 'src' directory
- biome ci --reporter=gitlab > code-quality.json

Perhaps the example should be less opinionated unless these additional params have been added so that exporting code-quality.json works as expected. You probably have tested this better than I have, so I'll trust your jugement on this.

Regardless, we probably don't want to refer to src, because there may be supported files somewhere else in the project

artifacts:
paths:
- code-quality.json # Collect the code quality report as an artifact
needs: [] # No dependent jobs needed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
needs: [] # No dependent jobs needed

If not required perhaps we could do without it in the example

rules:
- if: $CI_COMMIT_BRANCH # Run job for commits on branches
- if: $CI_MERGE_REQUEST_ID # Run job for merge requests
allow_failure: true # Allow the job to fail (adjust as needed)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
allow_failure: true # Allow the job to fail (adjust as needed)

Perhaps we remove this one too. I expect people who use GitLab CI on a daily basis to know about this option. It keeps the example leaner. What do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants