Skip to content

feat: add plugins-benchmark-pr.yml#90

Merged
Uzlopak merged 4 commits into
mainfrom
benchmark
Aug 8, 2023
Merged

feat: add plugins-benchmark-pr.yml#90
Uzlopak merged 4 commits into
mainfrom
benchmark

Conversation

@Uzlopak

@Uzlopak Uzlopak commented Aug 4, 2023

Copy link
Copy Markdown
Contributor

Resolves #89

You can see an example output here: Uzlopak/fast-json-stringify#4 (comment)

Can be integrated like this:

name: Benchmark PR

on:
  pull_request_target:
    types: 
      - labeled

jobs:
  benchmark:
    if: ${{ github.event.label.name == 'benchmark' }}
    uses: fastify/workflows/.github/workflows/plugins-benchmark-pr.yml@main
    with:
      npm-script: bench

  remove-label:
    if: "always()"
    needs: 
      - benchmark
    runs-on: ubuntu-latest
    steps:
      - name: Remove benchmark label
        uses: octokit/request-action@v2.x
        id: remove-label
        with:
          route: DELETE /repos/{repo}/issues/{issue_number}/labels/{name}
          repo: ${{ github.event.pull_request.head.repo.full_name }}
          issue_number: ${{ github.event.pull_request.number }}
          name: benchmark
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Checklist

@RafaelGSS RafaelGSS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it working for forks? IIRC I faced a behavior where actions/checkout wasn't able to checkout a branch due to missing pull_request_target on the event type

@Uzlopak

Uzlopak commented Aug 5, 2023

Copy link
Copy Markdown
Contributor Author

Well renamed the reusable wf to plugins-benchmark-pr.

Well this benchmark wf is only usable with events of type pull_request.

@Uzlopak Uzlopak changed the title feat: add benchmark.yml feat: add plugins-benchmark-pr.yml Aug 5, 2023
@Uzlopak

Uzlopak commented Aug 5, 2023

Copy link
Copy Markdown
Contributor Author

If you overall like the workflow, I can add the documentation, where i specify how to use it.

Fdawgs
Fdawgs previously approved these changes Aug 6, 2023
@Uzlopak

Uzlopak commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

@Fdawgs can you have a look over the readme.md?

@Fdawgs

Fdawgs commented Aug 8, 2023

Copy link
Copy Markdown
Member

@Fdawgs can you have a look over the readme.md?

Will hop on it around 17:30 BST after work 😊

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
@Uzlopak

Uzlopak commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

@Fdawgs
adapted

@Uzlopak
Uzlopak merged commit 779cc0c into main Aug 8, 2023
@Uzlopak
Uzlopak deleted the benchmark branch August 8, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Benchmark workflow

4 participants