diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark_configuration.yml similarity index 60% rename from .github/workflows/benchmark.yml rename to .github/workflows/benchmark_configuration.yml index 60ac333350c6..95afc3e78e72 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark_configuration.yml @@ -1,4 +1,4 @@ -name: Benchmarks +name: Benchmarks Configuration on: workflow_dispatch: @@ -9,13 +9,7 @@ on: - next paths: - 'Cargo.lock' - - 'crates/**_analyze/**/*.rs' - - 'crates/**_formatter/**/*.rs' - - 'crates/**_parser/**/*.rs' - 'crates/biome_configuration/**/*.rs' - - 'crates/biome_grit_patterns/**/*.rs' - - 'crates/biome_module_graph/**/*.rs' - - 'crates/biome_package/**/*.rs' - 'crates/biome_rowan/**/*.rs' push: branches: @@ -23,13 +17,7 @@ on: - next paths: - 'Cargo.lock' - - 'crates/**_analyze/**/*.rs' - - 'crates/**_formatter/**/*.rs' - - 'crates/**_parser/**/*.rs' - 'crates/biome_configuration/**/*.rs' - - 'crates/biome_grit_patterns/**/*.rs' - - 'crates/biome_module_graph/**/*.rs' - - 'crates/biome_package/**/*.rs' - 'crates/biome_rowan/**/*.rs' env: @@ -44,21 +32,6 @@ jobs: strategy: matrix: package: - - biome_js_parser - - biome_js_formatter - - biome_js_analyze - - biome_css_parser - - biome_css_formatter - - biome_css_analyze - - biome_json_parser - - biome_json_formatter - - biome_json_analyze - - biome_graphql_parser - - biome_graphql_formatter - - biome_html_parser - - biome_html_formatter - - biome_module_graph - - biome_package - biome_configuration steps: @@ -66,7 +39,7 @@ jobs: - name: Checkout PR Branch uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: - ref: ${{ steps.sha.outputs.result }} + ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Install toolchain uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2 diff --git a/.github/workflows/benchmark_css.yml b/.github/workflows/benchmark_css.yml new file mode 100644 index 000000000000..9d069ccc69ed --- /dev/null +++ b/.github/workflows/benchmark_css.yml @@ -0,0 +1,75 @@ +name: Benchmarks CSS + +on: + workflow_dispatch: + pull_request: + types: [ opened, synchronize ] + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_css_analyze/**/*.rs' + - 'crates/biome_css_formatter/**/*.rs' + - 'crates/biome_css_parser/**/*.rs' + - 'crates/biome_css_*/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + - 'crates/biome_parser/**/*.rs' + push: + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_css_analyze/**/*.rs' + - 'crates/biome_css_formatter/**/*.rs' + - 'crates/biome_css_parser/**/*.rs' + - 'crates/biome_css_*/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + - 'crates/biome_parser/**/*.rs' + +env: + RUST_LOG: info + +jobs: + bench: + permissions: + pull-requests: write + name: Bench + runs-on: depot-ubuntu-24.04-arm-16 + strategy: + matrix: + package: + - biome_css_parser + - biome_css_formatter + - biome_css_analyze + + steps: + + - name: Checkout PR Branch + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Install toolchain + uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2 + with: + channel: stable + cache-target: release + bins: cargo-codspeed + cache-base: main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile + timeout-minutes: 20 + run: cargo codspeed build -p ${{ matrix.package }} + env: + CARGO_BUILD_JOBS: 3 # Default is 4 (equals to the vCPU count of the runner), which leads OOM on cargo build + + - name: Run the benchmarks + uses: CodSpeedHQ/action@76578c2a7ddd928664caa737f0e962e3085d4e7c # v3.8.1 + timeout-minutes: 50 + with: + run: cargo codspeed run + token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/benchmark_graphql.yml b/.github/workflows/benchmark_graphql.yml new file mode 100644 index 000000000000..a2c6c26bfed7 --- /dev/null +++ b/.github/workflows/benchmark_graphql.yml @@ -0,0 +1,72 @@ +name: Benchmarks GraphQL + +on: + workflow_dispatch: + pull_request: + types: [ opened, synchronize ] + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_graphql_formatter/**/*.rs' + - 'crates/biome_graphql_parser/**/*.rs' + - 'crates/biome_graphql_*/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + - 'crates/biome_parser/**/*.rs' + push: + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_graphql_formatter/**/*.rs' + - 'crates/biome_graphql_parser/**/*.rs' + - 'crates/biome_graphql_*/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + - 'crates/biome_parser/**/*.rs' + +env: + RUST_LOG: info + +jobs: + bench: + permissions: + pull-requests: write + name: Bench + runs-on: depot-ubuntu-24.04-arm-16 + strategy: + matrix: + package: + - biome_graphql_parser + - biome_graphql_formatter + + steps: + + - name: Checkout PR Branch + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Install toolchain + uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2 + with: + channel: stable + cache-target: release + bins: cargo-codspeed + cache-base: main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile + timeout-minutes: 20 + run: cargo codspeed build -p ${{ matrix.package }} + env: + CARGO_BUILD_JOBS: 3 # Default is 4 (equals to the vCPU count of the runner), which leads OOM on cargo build + + - name: Run the benchmarks + uses: CodSpeedHQ/action@76578c2a7ddd928664caa737f0e962e3085d4e7c # v3.8.1 + timeout-minutes: 50 + with: + run: cargo codspeed run + token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/benchmark_js.yml b/.github/workflows/benchmark_js.yml new file mode 100644 index 000000000000..89ae9e4787d7 --- /dev/null +++ b/.github/workflows/benchmark_js.yml @@ -0,0 +1,75 @@ +name: Benchmarks JS + +on: + workflow_dispatch: + pull_request: + types: [ opened, synchronize ] + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_js_analyze/**/*.rs' + - 'crates/biome_js_formatter/**/*.rs' + - 'crates/biome_js_parser/**/*.rs' + - 'crates/biome_js_*/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + - 'crates/biome_parser/**/*.rs' + push: + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_js_analyze/**/*.rs' + - 'crates/biome_js_formatter/**/*.rs' + - 'crates/biome_js_parser/**/*.rs' + - 'crates/biome_js_*/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + - 'crates/biome_parser/**/*.rs' + +env: + RUST_LOG: info + +jobs: + bench: + permissions: + pull-requests: write + name: Bench + runs-on: depot-ubuntu-24.04-arm-16 + strategy: + matrix: + package: + - biome_js_parser + - biome_js_formatter + - biome_js_analyze + + steps: + + - name: Checkout PR Branch + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Install toolchain + uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2 + with: + channel: stable + cache-target: release + bins: cargo-codspeed + cache-base: main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile + timeout-minutes: 20 + run: cargo codspeed build -p ${{ matrix.package }} + env: + CARGO_BUILD_JOBS: 3 # Default is 4 (equals to the vCPU count of the runner), which leads OOM on cargo build + + - name: Run the benchmarks + uses: CodSpeedHQ/action@76578c2a7ddd928664caa737f0e962e3085d4e7c # v3.8.1 + timeout-minutes: 50 + with: + run: cargo codspeed run + token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/benchmark_json.yml b/.github/workflows/benchmark_json.yml new file mode 100644 index 000000000000..ed2ce78a90cb --- /dev/null +++ b/.github/workflows/benchmark_json.yml @@ -0,0 +1,75 @@ +name: Benchmarks JSON + +on: + workflow_dispatch: + pull_request: + types: [ opened, synchronize ] + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_json_analyze/**/*.rs' + - 'crates/biome_json_formatter/**/*.rs' + - 'crates/biome_json_parser/**/*.rs' + - 'crates/biome_json_*/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + - 'crates/biome_parser/**/*.rs' + push: + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_json_analyze/**/*.rs' + - 'crates/biome_json_formatter/**/*.rs' + - 'crates/biome_json_parser/**/*.rs' + - 'crates/biome_json_*/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + - 'crates/biome_parser/**/*.rs' + +env: + RUST_LOG: info + +jobs: + bench: + permissions: + pull-requests: write + name: Bench + runs-on: depot-ubuntu-24.04-arm-16 + strategy: + matrix: + package: + - biome_json_parser + - biome_json_formatter + - biome_json_analyze + + steps: + + - name: Checkout PR Branch + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Install toolchain + uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2 + with: + channel: stable + cache-target: release + bins: cargo-codspeed + cache-base: main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile + timeout-minutes: 20 + run: cargo codspeed build -p ${{ matrix.package }} + env: + CARGO_BUILD_JOBS: 3 # Default is 4 (equals to the vCPU count of the runner), which leads OOM on cargo build + + - name: Run the benchmarks + uses: CodSpeedHQ/action@76578c2a7ddd928664caa737f0e962e3085d4e7c # v3.8.1 + timeout-minutes: 50 + with: + run: cargo codspeed run + token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/benchmark_manifests.yml b/.github/workflows/benchmark_manifests.yml new file mode 100644 index 000000000000..100854b3a2b4 --- /dev/null +++ b/.github/workflows/benchmark_manifests.yml @@ -0,0 +1,65 @@ +name: Benchmarks Manifests + +on: + workflow_dispatch: + pull_request: + types: [ opened, synchronize ] + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_package/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + push: + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_package/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + +env: + RUST_LOG: info + +jobs: + bench: + permissions: + pull-requests: write + name: Bench + runs-on: depot-ubuntu-24.04-arm-16 + strategy: + matrix: + package: + - biome_package + + steps: + + - name: Checkout PR Branch + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Install toolchain + uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2 + with: + channel: stable + cache-target: release + bins: cargo-codspeed + cache-base: main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile + timeout-minutes: 20 + run: cargo codspeed build -p ${{ matrix.package }} + env: + CARGO_BUILD_JOBS: 3 # Default is 4 (equals to the vCPU count of the runner), which leads OOM on cargo build + + - name: Run the benchmarks + uses: CodSpeedHQ/action@76578c2a7ddd928664caa737f0e962e3085d4e7c # v3.8.1 + timeout-minutes: 50 + with: + run: cargo codspeed run + token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/benchmark_module_graph.yml b/.github/workflows/benchmark_module_graph.yml new file mode 100644 index 000000000000..06c9109b7ee3 --- /dev/null +++ b/.github/workflows/benchmark_module_graph.yml @@ -0,0 +1,65 @@ +name: Benchmarks Module Graph + +on: + workflow_dispatch: + pull_request: + types: [ opened, synchronize ] + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_module_graph/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + push: + branches: + - main + - next + paths: + - 'Cargo.lock' + - 'crates/biome_module_graph/**/*.rs' + - 'crates/biome_rowan/**/*.rs' + +env: + RUST_LOG: info + +jobs: + bench: + permissions: + pull-requests: write + name: Bench + runs-on: depot-ubuntu-24.04-arm-16 + strategy: + matrix: + package: + - biome_module_graph + + steps: + + - name: Checkout PR Branch + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + - name: Install toolchain + uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2 + with: + channel: stable + cache-target: release + bins: cargo-codspeed + cache-base: main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Compile + timeout-minutes: 20 + run: cargo codspeed build -p ${{ matrix.package }} + env: + CARGO_BUILD_JOBS: 3 # Default is 4 (equals to the vCPU count of the runner), which leads OOM on cargo build + + - name: Run the benchmarks + uses: CodSpeedHQ/action@76578c2a7ddd928664caa737f0e962e3085d4e7c # v3.8.1 + timeout-minutes: 50 + with: + run: cargo codspeed run + token: ${{ secrets.CODSPEED_TOKEN }}