From 0b8f66eb30194cd72653485875506791a802c5f8 Mon Sep 17 00:00:00 2001 From: Sergio Maria Matone Date: Thu, 3 Oct 2024 11:02:47 +0200 Subject: [PATCH] restructuring benchmarks workflow, triggered only with merge on master branch --- .github/workflows/benchmark-check.yml | 13 ------- ...template.yml => benchmark-master-push.yml} | 34 ++++++++----------- .github/workflows/benchmark-publish.yml | 15 -------- 3 files changed, 14 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/benchmark-check.yml rename .github/workflows/{benchmark_template.yml => benchmark-master-push.yml} (74%) delete mode 100644 .github/workflows/benchmark-publish.yml diff --git a/.github/workflows/benchmark-check.yml b/.github/workflows/benchmark-check.yml deleted file mode 100644 index 8f763d1ec11..00000000000 --- a/.github/workflows/benchmark-check.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: run benchmarks on every PR - -on: - pull_request: - -jobs: - check: - uses: ./.github/workflows/benchmark_template.yml - secrets: inherit - with: - publish: false - test-flags: "-short" - external-data-json-path: "./cache/benchmark-data.json" \ No newline at end of file diff --git a/.github/workflows/benchmark_template.yml b/.github/workflows/benchmark-master-push.yml similarity index 74% rename from .github/workflows/benchmark_template.yml rename to .github/workflows/benchmark-master-push.yml index f7988a463c6..7067395bc59 100644 --- a/.github/workflows/benchmark_template.yml +++ b/.github/workflows/benchmark-master-push.yml @@ -1,18 +1,11 @@ -name: benchmarks +name: run benchmarks when pushing on main branch + on: - workflow_call: - inputs: - publish: - required: true - type: boolean - test-flags: - required: true - type: string - runner-additional-tag: - type: string - default: benchmarks - external-data-json-path: - type: string + push: + branches: + - master + + # publish: true permissions: # deployments permission to deploy GitHub pages website @@ -26,7 +19,7 @@ env: jobs: benchmarks: if: ${{ github.repository == 'gnolang/gno' }} - runs-on: [self-hosted, Linux, X64, "${{ inputs.runner-additional-tag }}"] + runs-on: [self-hosted, Linux, X64, benchmarks] steps: - name: Checkout uses: actions/checkout@v4 @@ -40,7 +33,7 @@ jobs: - name: Run benchmark run: | go test -benchmem -bench=. ./... -run=^$ \ - -cpu 1,2 ${{ inputs.test-flags }} | tee benchmarks.txt + -cpu 1,2 -timeout 50m | tee benchmarks.txt - name: Download previous benchmark data uses: actions/cache@v4 @@ -56,11 +49,13 @@ jobs: tool: 'go' output-file-path: benchmarks.txt # Where the previous data file is stored - external-data-json-path: ${{ inputs.external-data-json-path }} + external-data-json-path: ./cache/benchmark-data.json + max-items-in-chart: 100 # Show alert with commit comment on detecting possible performance regression - alert-threshold: '20%' + alert-threshold: '100%' fail-on-alert: true comment-on-alert: true + alert-comment-cc-users: '@ajnavarro,@thehowl,@zivkovicmilos' # Enable Job Summary for PRs summary-always: true github-token: ${{ secrets.GITHUB_TOKEN }} @@ -68,5 +63,4 @@ jobs: # gh-repository: 'github.com/gnolang/benchmarks' # on gh-pages branch gh-pages-branch: gh-benchmarks benchmark-data-dir-path: . - auto-push: ${{ inputs.publish }} - alert-comment-cc-users: '@ajnavarro,@thehowl,@zivkovicmilos' + auto-push: true diff --git a/.github/workflows/benchmark-publish.yml b/.github/workflows/benchmark-publish.yml deleted file mode 100644 index 37fd452a163..00000000000 --- a/.github/workflows/benchmark-publish.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: run benchmarks on main branch every day - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' # run on default branch every day - -jobs: - publish: - uses: ./.github/workflows/benchmark_template.yml - secrets: inherit - with: - publish: true - test-flags: "-timeout 50m" - runner-additional-tag: "benchmarks-large" \ No newline at end of file