Skip to content

chore(deps): bump the gofiber group across 10 directories with 1 update #312

chore(deps): bump the gofiber group across 10 directories with 1 update

chore(deps): bump the gofiber group across 10 directories with 1 update #312

Workflow file for this run

name: Benchmark
on:
workflow_dispatch:
push:
branches:
- "master"
- "main"
paths:
- "**/*.go"
- "**/go.mod"
- ".github/workflows/benchmark.yml"
pull_request:
paths:
- "**/*.go"
- "**/go.mod"
- ".github/workflows/benchmark.yml"
permissions:
deployments: write
contents: write
pull-requests: write
jobs:
compare:
runs-on: ubuntu-latest
steps:
- name: Fetch Repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v6
with:
# NOTE: Keep this in sync with the version from go.mod
go-version: "1.25.x"
cache: false
- name: Run Benchmarks
shell: bash
run: |
set -euo pipefail
: > output.txt
for d in */ ; do
if [[ ! -f "${d}go.mod" ]]; then
continue
fi
(
cd "$d"
go test ./... -benchmem -run=^$ -bench .
) | tee -a output.txt
done
- name: Get GitHub Runner System Information
uses: kenchan0130/actions-system-info@v1.4.0
id: system-info
- name: Get Default branch SHA
id: get-default-branch-sha
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
shell: bash
run: |
set -euo pipefail
SHA="$(git ls-remote origin "${DEFAULT_BRANCH}" | awk 'NR==1 {print $1}')"
if [[ -z "${SHA}" ]]; then
echo "Failed to resolve SHA for default branch '${DEFAULT_BRANCH}'" >&2
exit 1
fi
echo "sha=${SHA}" >> "$GITHUB_OUTPUT"
- name: Build normalized cache key
id: cache-key
env:
CPU_MODEL: ${{ steps.system-info.outputs.cpu-model }}
BASE_SHA: ${{ steps.get-default-branch-sha.outputs.sha }}
shell: bash
run: |
set -euo pipefail
SAFE_CPU_MODEL="$(printf '%s' "$CPU_MODEL" | tr -cs '[:alnum:]._-' '-')"
SAFE_CPU_MODEL="${SAFE_CPU_MODEL#-}"
SAFE_CPU_MODEL="${SAFE_CPU_MODEL%-}"
echo "key=${BASE_SHA}-${{ runner.os }}-${SAFE_CPU_MODEL}-benchmark" >> "$GITHUB_OUTPUT"
- name: Get Benchmark Results from default branch
id: cache
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ./cache
key: ${{ steps.cache-key.outputs.key }}
- name: Compare PR Benchmark Results with default branch
if: ${{ github.event_name == 'pull_request' && steps.cache.outputs.cache-hit == 'true' }}
uses: benchmark-action/github-action-benchmark@v1.20.7
with:
tool: "go"
output-file-path: output.txt
external-data-json-path: ./cache/benchmark-data.json
save-data-file: false
fail-on-alert: true
comment-on-alert: ${{ github.event.pull_request.head.repo.fork == false }}
github-token: ${{ secrets.GITHUB_TOKEN }}
summary-always: true
alert-threshold: "150%"
- name: Store Benchmark Results for default branch
if: ${{ github.ref_name == github.event.repository.default_branch }}
uses: benchmark-action/github-action-benchmark@v1.20.7
with:
tool: "go"
output-file-path: output.txt
external-data-json-path: ./cache/benchmark-data.json
save-data-file: true
fail-on-alert: false
github-token: ${{ secrets.GITHUB_TOKEN }}
summary-always: true
alert-threshold: "150%"
auto-push: false
- name: Publish Benchmark Results to GitHub Pages
if: ${{ github.ref_name == github.event.repository.default_branch }}
uses: benchmark-action/github-action-benchmark@v1.20.7
with:
tool: "go"
output-file-path: output.txt
benchmark-data-dir-path: "benchmarks"
fail-on-alert: false
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: false
summary-always: true
save-data-file: true
alert-threshold: "150%"
auto-push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
- name: Update Benchmark Results cache
if: ${{ github.ref_name == github.event.repository.default_branch }}
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ./cache
key: ${{ steps.cache-key.outputs.key }}