mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: Reusable Benchmark
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
benchmark:
|
|
runs-on: ubuntu-latest
|
|
concurrency:
|
|
group: benchmark
|
|
cancel-in-progress: false
|
|
steps:
|
|
- name: checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: download benchmark data
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
pattern: benchmark-*
|
|
path: benchmarks
|
|
|
|
- name: merge benchmark data
|
|
run: jq -s 'add' benchmarks/*/benchmark.json > benchmark.json
|
|
|
|
- name: save benchmark dashboard
|
|
run: cp .github/benchmark-index.html "$RUNNER_TEMP/benchmark-index.html"
|
|
|
|
- name: store benchmark result
|
|
uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1.22.1
|
|
with:
|
|
name: Fastfetch
|
|
tool: customSmallerIsBetter
|
|
output-file-path: benchmark.json
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
ref: ${{ github.sha }}
|
|
auto-push: true
|
|
summary-always: true
|
|
benchmark-data-dir-path: dev/bench
|
|
|
|
- name: publish benchmark dashboard
|
|
run: |
|
|
git fetch origin gh-pages
|
|
git switch --force-create gh-pages FETCH_HEAD
|
|
mkdir -p dev/bench
|
|
cp "$RUNNER_TEMP/benchmark-index.html" dev/bench/index.html
|
|
git config user.name github-action-benchmark
|
|
git config user.email github@users.noreply.github.com
|
|
git add dev/bench/index.html
|
|
if ! git diff --cached --quiet; then
|
|
git commit -m "Update benchmark dashboard"
|
|
git push origin gh-pages
|
|
fi
|