Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Aug 8, 2023
Merged

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

merged 4 commits into from
Aug 8, 2023

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Aug 4, 2023

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

Copy link
Member

@RafaelGSS RafaelGSS left a comment

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
Copy link
Contributor Author

Uzlopak commented Aug 5, 2023

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
Copy link
Contributor Author

Uzlopak commented Aug 5, 2023

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
Copy link
Contributor Author

Uzlopak commented Aug 8, 2023

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

@Fdawgs
Copy link
Member

Fdawgs commented Aug 8, 2023

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

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

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
@Uzlopak
Copy link
Contributor Author

Uzlopak commented Aug 8, 2023

@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