Skip to content

Merge remote-tracking branch 'origin/main' #5647

Merge remote-tracking branch 'origin/main'

Merge remote-tracking branch 'origin/main' #5647

Workflow file for this run

name: Benchmark
on:
workflow_dispatch:
push:
branches:
- master
- main
paths:
- "**"
- "!**.md"
pull_request:
paths:
- "**"
- "!**.md"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
deployments: write
contents: write
pull-requests: write
jobs:
changes:
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 30
permissions:
pull-requests: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Generate filters
id: filter-setup
run: |
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . ! -path ./testhelpers -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
{
echo "filters<<EOF"
echo "$filters"
echo "EOF"
} >> "$GITHUB_OUTPUT"
shell: bash
- name: Filter changes
id: filter
if: github.event_name != 'workflow_dispatch'
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4
with:
filters: ${{ steps.filter-setup.outputs.filters }}
# A manual dispatch runs every package: publishes all benchmark data,
# deploys the shared page and seeds the PR-compare caches.
- name: List all packages
id: all-packages
if: github.event_name == 'workflow_dispatch'
shell: bash
run: |
packages=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . ! -path ./testhelpers -exec basename {} \; | grep -v '^\.' | jq -R -s -c 'split("\n") | map(select(length > 0)) | sort')
echo "packages=$packages" >> "$GITHUB_OUTPUT"
outputs:
packages: ${{ github.event_name == 'workflow_dispatch' && steps.all-packages.outputs.packages || steps.filter.outputs.changes || '[]' }}
compare:
needs: changes
if: needs.changes.outputs.packages != '[]' # Ensure job runs only if there are changes
strategy:
matrix:
package: ${{ fromJSON(needs.changes.outputs.packages || '[]') }}
fail-fast: false
uses: gofiber/.github/.github/workflows/benchmark.yml@main
with:
# stays on x64 while the org default is arm64: mcmoe/mssqldocker ships amd64 only
runs-on: blacksmith-2vcpu-ubuntu-2404
working-directory: ${{ matrix.package }}
benchmark-data-dir-path: benchmarks/${{ matrix.package }}
# NOTE: clickhouse requires a newer Go than the org default (see 738edc85)
go-version: ${{ matrix.package == 'clickhouse' && 'stable' || '1.25.x' }}
go-test-flags: "-timeout 900s"
alert-threshold: "300%"
# ~3 months of per-package publishes (24-27 in the last 90 days)
max-items-in-chart: 30
setup-script: .github/scripts/benchmark-setup.sh
# the update-pages job below syncs the page once after all matrix legs
sync-pages: false
update-pages:
needs: compare
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 10
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == github.event.repository.default_branch
steps:
- name: Sync Benchmark Page
uses: gofiber/.github/.github/actions/benchmark-pages@main