fastify / workflows

Reusable workflows for use in the Fastify organization
MIT License
9 stars 6 forks source link

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

Closed Uzlopak closed 1 year ago

Uzlopak commented 1 year ago

Resolves #89

You can see an example output here: https://github.com/Uzlopak/fast-json-stringify/pull/4#issuecomment-1666122071

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

Uzlopak commented 1 year ago

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

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

Uzlopak commented 1 year ago

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

Uzlopak commented 1 year ago

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

Fdawgs commented 1 year ago

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

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

Uzlopak commented 1 year ago

@Fdawgs adapted