Skip to content

chore: refactor benchmark #1

chore: refactor benchmark

chore: refactor benchmark #1

Workflow file for this run

name: benchmarks
on:
workflow_call:
inputs:
publish:
required: true
type: boolean
test-flags:
required: true
type: string
jobs:
benchmarks:
runs-on: [self-hosted, Linux, X64, benchmark-v1]
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: "gobenchdata publish: ${{ inputs.publish }}"
run: go run go.bobheadxi.dev/gobenchdata@v1 action
env:
INPUT_PRUNE_COUNT: 30
INPUT_GO_TEST_FLAGS: "${{ inputs.test-flags }} -run=^$ -cpu 1,2" # executing only using one and two CPUs to not be dependant on the machine cores.
INPUT_PUBLISH: ${{ inputs.publish }}
INPUT_PUBLISH_BRANCH: gh-benchmarks
INPUT_BENCHMARKS_OUT: benchmarks.json
INPUT_CHECKS: ${{ !inputs.publish }}
INPUT_CHECKS_CONFIG: .benchmarks/gobenchdata-checks.yml
on:

Check failure on line 33 in .github/workflows/benchmark.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/benchmark.yml

Invalid workflow file

You have an error in your yaml syntax on line 33
# manual trigger
workflow_dispatch:
inputs:
publish:
required: true
type: boolean
default: false
test-flags:
required: true
default: '-short timeout 50m'
type: string
# on PR, just for checking
pull_request:
# cron, to publish results
schedule:
- cron: '0 0 * * *' # run on default branch every day
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: "gobenchdata publish: ${{ inputs.publish }}"
run: go run go.bobheadxi.dev/gobenchdata@v1 action
env:
INPUT_PRUNE_COUNT: 30
INPUT_GO_TEST_FLAGS: "${{ inputs.test-flags }} -run=^$ -cpu 1,2" # executing only using one and two CPUs to not be dependant on the machine cores.
INPUT_PUBLISH: ${{ inputs.publish }}
INPUT_PUBLISH_BRANCH: gh-benchmarks
INPUT_BENCHMARKS_OUT: benchmarks.json
INPUT_CHECKS: ${{ !inputs.publish }}
INPUT_CHECKS_CONFIG: .benchmarks/gobenchdata-checks.yml
check:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/benchmark.yml
secrets: inherit
with:
publish: false
test-flags: "-short"
publish:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/benchmark.yml
secrets: inherit
with:
publish: true
test-flags: "-timeout 50m"