Biome Ecosystem CI #137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Biome Ecosystem CI | |
permissions: | |
contents: none | |
on: | |
schedule: | |
- cron: "0 5 * * 1,3,5" # monday,wednesday,friday 5AM | |
workflow_dispatch: | |
inputs: | |
biome-ref: | |
description: biomejs/biome reference to checkout | |
type: string | |
default: main | |
jobs: | |
build-biome: | |
name: Build Biome (${{ inputs.biome-ref || 'main' }}) | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Biome | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
repository: biomejs/biome | |
ref: ${{ inputs.biome-ref }} | |
- name: Install toolchain | |
uses: moonrepo/setup-rust@e013866c4215f77c925f42f60257dec7dd18836e # v1.2.1 | |
with: | |
cache-target: release | |
cache-base: main | |
- name: Build Biome binary | |
env: | |
# We set `BIOME_VERSION` to disable the recommended rules from the nursery group | |
# The version needs to be different from 0.0.0 | |
BIOME_VERSION: 0.0.1 | |
RUSTFLAGS: -C debug-assertions | |
run: | | |
cargo build --bin biome --release | |
- name: Upload Biome binary | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
if-no-files-found: error | |
retention-days: 10 | |
name: biome | |
path: ./target/release/biome | |
test-ecosystem: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Add projects to test here | |
# Supported fields: | |
# - id: identifier | |
# - repository: GitHub repository to checkout | |
# - ref: ref to checkout (default is the default branch) | |
# - working-directory: where to execute `biome` (default is the root of the repository) | |
# The path is relative to the root of the repository | |
# - arguments: extra arguments to pass to the `biome check` command (default is `.`) | |
- id: ant-design | |
repository: ant-design/ant-design | |
- id: apify-crawlee | |
repository: apify/crawlee | |
arguments: --organize-imports-enabled=false . | |
- id: ariakit | |
repository: ariakit/ariakit | |
- id: astro | |
repository: withastro/astro | |
- id: baidu-amis | |
repository: baidu/amis | |
working-directory: packages/office-viewer/ | |
arguments: --organize-imports-enabled=false . | |
- id: coder | |
repository: coder/coder | |
working-directory: site/ | |
arguments: e2e/ src/ | |
- id: daisyui | |
repository: saadeghi/daisyui | |
- id: discordjs | |
repository: discordjs/discord.js | |
- id: FluidFramework | |
repository: microsoft/FluidFramework | |
- id: farm-fe | |
repository: farm-fe/farm | |
- id: fiftyone-app | |
repository: voxel51/fiftyone | |
working-directory: app/packages/app/ | |
arguments: ./src | |
- id: fiftyone-looker-3d | |
repository: voxel51/fiftyone | |
working-directory: app/packages/looker-3d/ | |
arguments: ./src | |
- id: fiftyone-spotlight | |
repository: voxel51/fiftyone | |
working-directory: app/packages/spotlight/ | |
arguments: ./src | |
- id: fontsource | |
repository: fontsource/fontsource | |
arguments: --organize-imports-enabled=false . | |
- id: full-stack-fastapi-template | |
repository: fastapi/full-stack-fastapi-template | |
working-directory: frontend/ | |
- id: google-mesop | |
repository: google/mesop | |
- id: knip | |
repository: webpro-nl/knip | |
- id: label-studio | |
repository: HumanSignal/label-studio | |
working-directory: web/ | |
- id: max-mapper-menubar | |
repository: max-mapper/menubar | |
- id: melonJS | |
repository: melonjs/melonJS | |
- id: nitro | |
repository: unjs/nitro | |
- id: openapi-fetch | |
repository: openapi-ts/openapi-typescript | |
working-directory: packages/openapi-fetch/ | |
- id: openapi-react-query | |
repository: openapi-ts/openapi-typescript | |
working-directory: packages/openapi-react-query/ | |
- id: openapi-typescript-helpers | |
repository: openapi-ts/openapi-typescript | |
working-directory: packages/openapi-typescript-helpers/ | |
- id: orama | |
repository: askorama/orama | |
arguments: --organize-imports-enabled=false . | |
- id: plotlyjs | |
repository: plotly/plotly.js | |
- id: pulumi | |
repository: pulumi/pulumi | |
working-directory: sdk/nodejs/ | |
- id: preact | |
repository: preactjs/preact | |
- id: react-data-grid | |
repository: adazzle/react-data-grid | |
- id: react-pdf | |
repository: wojtekmaj/react-pdf | |
arguments: --organize-imports-enabled=false . | |
- id: refine | |
repository: refinedev/refine | |
- id: rescript-compiler | |
repository: rescript-lang/rescript-compiler | |
- id: rspack | |
repository: web-infra-dev/rspack | |
- id: runtipi | |
repository: runtipi/runtipi | |
- id: sentry | |
repository: getsentry/sentry | |
- id: sentry-javascript | |
repository: getsentry/sentry-javascript | |
- id: spicetify | |
repository: spicetify/cli | |
- id: steven-tey-novel-headless | |
repository: steven-tey/novel | |
working-directory: packages/headless/ | |
- id: steven-tey-novel-web | |
repository: steven-tey/novel | |
working-directory: apps/web/ | |
arguments: --organize-imports-enabled=false . | |
- id: tamagui | |
repository: tamagui/tamagui | |
- id: unleash | |
repository: Unleash/unleash | |
- id: wagmi | |
repository: wevm/wagmi | |
name: Test ${{ matrix.id }} | |
needs: build-biome | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Biome binary | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: biome | |
path: bin/ | |
- run: | | |
chmod +x bin/biome | |
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | |
- name: Checkout ${{ matrix.repository }} | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
repository: ${{ matrix.repository }} | |
sparse-checkout: ${{ matrix.working-directory }} | |
ref: ${{ matrix.ref }} | |
path: repository | |
- name: Test details | |
id: test | |
working-directory: repository/${{ matrix.working-directory }} | |
run: | | |
biome check --error-on-warnings --max-diagnostics=1000 ${{ matrix.arguments || '.' }} | |
- name: Test summary | |
if: ${{ ! cancelled() }} | |
working-directory: repository/${{ matrix.working-directory }} | |
run: > | |
biome check --reporter=summary ${{ matrix.arguments || '.' }} 2> /dev/null | |
| tee "$GITHUB_WORKSPACE/biome-summary.txt"; | |
- name: Upload Biome summary | |
# Don't save the summary if the biome binary was not built on main. | |
if: ${{ ! cancelled() && (! inputs.biome-ref || inputs.biome-ref == 'main') }} | |
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 | |
with: | |
if-no-files-found: error | |
retention-days: 10 | |
name: biome-summary-${{ matrix.id }} | |
path: biome-summary.txt | |
- name: Download previous Biome summary | |
if: ${{ ! cancelled() }} | |
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6.0.0 | |
with: | |
workflow_conclusion: completed | |
# Find the most recent workflow run with an artifact with the given `name` | |
search_artifacts: true | |
if_no_artifact_found: warn | |
name: biome-summary-${{ matrix.id }} | |
path: downloads/ | |
# Steps to notify Discord | |
- name: Notification tag and Biome summary diff | |
if: ${{ always() }} | |
id: notification | |
run: | | |
if ${{ steps.test.outcome == 'success' }}; then | |
TAG='✅' | |
elif ${{ steps.test.outcome == 'failure' }}; then | |
TAG='❌' | |
else | |
TAG='❓' | |
fi | |
if ! test -e downloads/biome-summary.txt || ! test -e biome-summary.txt; then | |
TAG="$TAG 🆕" | |
elif ! diff --color=auto --minimal --unified=1000 --ignore-matching-line='^Checked' --ignore-all-space downloads/biome-summary.txt biome-summary.txt; then | |
if test "$(wc -l < downloads/biome-summary.txt)" -le "$(wc -l < biome-summary.txt)"; then | |
TAG="$TAG 📈" | |
else | |
TAG="$TAG 📉" | |
fi | |
fi | |
if test -e biome-summary.txt; then | |
TIME="$(sed -En 's/^Checked.*in ([0-9]+m?s).*/\1/p' < biome-summary.txt)" | |
else | |
TIME='?' | |
fi | |
echo "TAG=$TAG" >> "$GITHUB_OUTPUT" | |
echo "TIME=$TIME" >> "$GITHUB_OUTPUT" | |
- name: Notify Discord | |
if: ${{ always() && steps.notification.outputs.TAG }} | |
uses: tsickert/discord-webhook@86dc739f3f165f16dadc5666051c367efa1692f4 # v6.0.0 | |
with: | |
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
content: "${{ steps.notification.outputs.TAG }} \ | |
biome(**${{ inputs.biome-ref || 'main' }}**) \ | |
**${{ matrix.id }}** \ | |
${{ steps.notification.outputs.TIME }} \ | |
[action](<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>)" |