Skip to content

Biome Ecosystem CI #347

Biome Ecosystem CI

Biome Ecosystem CI #347

Workflow file for this run

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: depot-ubuntu-24.04-arm-64
steps:
- name: Checkout Biome
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: biomejs/biome
ref: ${{ inputs.biome-ref }}
- name: Install toolchain
uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2
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@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
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: --assist-enabled=false .
- id: ariakit
repository: ariakit/ariakit
- id: astro
repository: withastro/astro
- id: baidu-amis
repository: baidu/amis
working-directory: packages/office-viewer/
arguments: --assist-enabled=false .
- id: coder
repository: coder/coder
working-directory: site/
arguments: e2e/ src/
- 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: --assist-enabled=false .
- id: full-stack-fastapi-template
repository: fastapi/full-stack-fastapi-template
working-directory: frontend/
- id: google-mesop
repository: google/mesop
- id: label-studio
repository: HumanSignal/label-studio
working-directory: web/
- id: max-mapper-menubar
repository: max-mapper/menubar
- id: melonJS
repository: melonjs/melonJS
- 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: pulumi
repository: pulumi/pulumi
working-directory: sdk/nodejs/
- id: preact
repository: preactjs/preact
- id: react-pdf
repository: wojtekmaj/react-pdf
arguments: --assist-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: 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: --assist-enabled=false .
- id: unleash
repository: Unleash/unleash
- id: wagmi
repository: wevm/wagmi
name: Test ${{ matrix.id }}
needs: build-biome
timeout-minutes: 5
runs-on: depot-ubuntu-24.04-arm-16
steps:
- name: Download Biome binary
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: biome
path: bin/
- run: |
chmod +x bin/biome
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Checkout ${{ matrix.repository }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ${{ matrix.repository }}
sparse-checkout: ${{ matrix.working-directory }}
ref: ${{ matrix.ref }}
path: repository
- name: Migrate
working-directory: repository/${{ matrix.working-directory }}
run: |
biome migrate --write
- name: Run Biome check and generate report
if: ${{ ! cancelled() }}
id: test
working-directory: repository/${{ matrix.working-directory }}
run: |
# Define report file path
REPORT_FILE="$GITHUB_WORKSPACE/biome-report-${{ matrix.id }}.json"
# Run biome check with JSON reporter to file, capture exit code but always succeed
# Using --reporter=json with --reporter-file writes JSON to the file
# The diagnostic limit is automatically lifted when using non-default reporters
set +e
biome check --error-on-warnings --reporter=json --reporter-file="$REPORT_FILE" ${{ matrix.arguments || '.' }}
BIOME_EXIT_CODE=$?
set -e
# Set outcome based on exit code
if [ $BIOME_EXIT_CODE -eq 0 ]; then
echo "outcome=success" >> "$GITHUB_OUTPUT"
else
echo "outcome=failure" >> "$GITHUB_OUTPUT"
fi
# Debug: Check if file was created
echo "Checking report file: $REPORT_FILE"
if [ -f "$REPORT_FILE" ]; then
FILE_SIZE=$(wc -c < "$REPORT_FILE")
echo "Report file exists, size: $FILE_SIZE bytes"
if [ $FILE_SIZE -gt 0 ]; then
echo "First 200 chars:"
head -c 200 "$REPORT_FILE" || true
fi
else
echo "ERROR: Report file was not created by Biome!"
fi
# If the report file doesn't exist or is empty, create error placeholder
if [ ! -f "$REPORT_FILE" ] || [ ! -s "$REPORT_FILE" ]; then
echo "Creating error placeholder because file is missing or empty"
echo '{"error": true}' > "$REPORT_FILE"
fi
- name: Upload Biome report
# Don't save the report if the biome binary was not built on main.
if: ${{ always() && (! inputs.biome-ref || inputs.biome-ref == 'main') }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
if-no-files-found: error
retention-days: 10
name: biome-report-${{ matrix.id }}
path: ${{ github.workspace }}/biome-report-${{ matrix.id }}.json
- name: Save outcome JSON
run: |
echo '{"id": "${{ matrix.id }}", "outcome": "${{ steps.test.outputs.outcome }}"}' > "$GITHUB_WORKSPACE/outcome-${{ matrix.id }}.json"
- name: Upload outcome
if: ${{ always() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
if-no-files-found: error
retention-days: 1
name: outcome-${{ matrix.id }}
path: ${{ github.workspace }}/outcome-${{ matrix.id }}.json
notify-discord:
name: Notify Discord
needs: test-ecosystem
runs-on: depot-ubuntu-24.04-arm-16
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: "24"
- name: Download all outcome artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: outcome-*
path: outcomes/
merge-multiple: true
- name: Download all biome report artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
pattern: biome-report-*
path: reports/
merge-multiple: true
- name: Download previous biome report artifacts
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6.0.0
with:
workflow_conclusion: completed
search_artifacts: true
if_no_artifact_found: warn
name_is_regexp: true
# exclude tamagui because its download fails
name: biome-report-(?!tamagui$).*
path: previous-reports/
skip_unpack: false
- name: Aggregate results
id: aggregate
run: |
MESSAGE=$(node --experimental-strip-types scripts/index.ts \
--outcomes-dir outcomes \
--reports-dir reports \
--previous-reports-dir previous-reports \
--biome-ref "${{ inputs.biome-ref || 'main' }}" \
--run-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}")
# Use heredoc to handle multiline output
{
echo 'message<<EOF'
echo "$MESSAGE"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Send Discord notification
uses: tsickert/discord-webhook@b217a69502f52803de774ded2b1ab7c282e99645 # v7.0.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
content: ${{ steps.aggregate.outputs.message }}