From 58890383147c082693cf3d6378e559cd2aadd9eb Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Tue, 12 Mar 2024 11:05:26 +0200 Subject: [PATCH] ci: Try and fix calling the `bench` workflow (#1734) * ci: Try and fix calling the `bench` workflow * Permissions * Fix condition * Fix --- .github/actions/pr-comment-data-export/action.yml | 8 ++------ .github/workflows/bench-comment.yml | 8 ++------ .github/workflows/bench.yml | 7 +------ .github/workflows/check.yml | 5 +++++ 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/actions/pr-comment-data-export/action.yml b/.github/actions/pr-comment-data-export/action.yml index dee56f0035..8a8cc50232 100644 --- a/.github/actions/pr-comment-data-export/action.yml +++ b/.github/actions/pr-comment-data-export/action.yml @@ -20,9 +20,7 @@ inputs: runs: using: composite steps: - - if: > - github.event.workflow_run.event == 'pull_request' || - github.event.workflow_run.event == 'workflow_run' + - if: github.event_name == 'pull_request' shell: bash run: | mkdir comment-data @@ -31,9 +29,7 @@ runs: echo "${{ inputs.log-url }}" > comment-data/log-url echo "${{ github.event.number }}" > comment-data/pr-number - - if: > - github.event.workflow_run.event == 'pull_request' || - github.event.workflow_run.event == 'workflow_run' + - if: github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: name: ${{ inputs.name }} diff --git a/.github/workflows/bench-comment.yml b/.github/workflows/bench-comment.yml index 10f8eda131..7bf7f4bba6 100644 --- a/.github/workflows/bench-comment.yml +++ b/.github/workflows/bench-comment.yml @@ -8,7 +8,7 @@ name: Benchmark Comment on: workflow_run: - workflows: ["Bench"] + workflows: ["CI"] types: - completed @@ -17,12 +17,8 @@ jobs: permissions: pull-requests: write runs-on: ubuntu-latest - if: > - github.event.workflow_run.event == 'pull_request' || - github.event.workflow_run.event == 'workflow_run' + if: github.event.workflow_run.event == 'pull_request' steps: - - uses: actions/checkout@v4 - - run: echo ${{ github.event.workflow_run.event }} - uses: ./.github/actions/pr-comment with: name: bench diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index e950671f58..09941e53f5 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -1,9 +1,6 @@ name: Bench on: - workflow_run: - workflows: ["CI"] - types: - - completed + workflow_call: workflow_dispatch: env: CARGO_PROFILE_BENCH_BUILD_OVERRIDE_DEBUG: true @@ -18,8 +15,6 @@ jobs: bench: name: Benchmark runs-on: self-hosted - permissions: - pull-requests: write defaults: run: shell: bash diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 48b0b15cc2..10085ffda6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -162,3 +162,8 @@ jobs: fail_ci_if_error: false token: ${{ secrets.CODECOV_TOKEN }} if: matrix.type == 'debug' && matrix.rust-toolchain == 'stable' + + bench: + name: "Benchmark" + needs: [check] + uses: ./.github/workflows/bench.yml