From b96dec1ca6a54b0b9ce190523d268020ed9fdba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hermann?= Date: Thu, 2 Apr 2026 16:51:54 +0200 Subject: [PATCH] feat: benchmark action --- .github/workflows/benchmark.yml | 59 +++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000..3948267 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,59 @@ +name: Benchmark + +on: + workflow_dispatch: + inputs: + ref: + description: Git ref to benchmark (branch, tag, or refs/pull//head) + required: false + default: main + type: string + +permissions: + contents: read + +concurrency: + group: local-benchmark-${{ github.event_name }}-${{ github.event.inputs.ref || github.ref }} + cancel-in-progress: true + +jobs: + benchmark: + name: Cloudstic local/local benchmark + runs-on: macos-latest + steps: + - name: Checkout target ref + uses: actions/checkout@v6 + with: + ref: ${{ github.event.inputs.ref || github.ref }} + + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - name: Run benchmark + shell: bash + run: | + set -euo pipefail + mkdir -p benchmark-results + ./scripts/benchmark/run.sh local local cloudstic | tee benchmark-results/local-local-cloudstic.txt + + - name: Publish summary + shell: bash + run: | + { + echo "## Local Benchmark" + echo "" + echo "- Ref: \`${{ github.event.inputs.ref || github.ref }}\`" + echo "- Runner: \`${{ runner.os }}\`" + echo "" + echo '```text' + cat benchmark-results/local-local-cloudstic.txt + echo '```' + } >> "$GITHUB_STEP_SUMMARY" + + - name: Upload benchmark artifact + uses: actions/upload-artifact@v4 + with: + name: local-local-cloudstic-benchmark + path: benchmark-results/local-local-cloudstic.txt