cloudflare/pint
Publicmirrored fromhttps://github.com/cloudflare/pintAvailable
.github/workflows/benchmark.yml
49lines · modecode
| 1 | name: Benchmark Go code |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | branches: |
| 6 | - main |
| 7 | |
| 8 | permissions: |
| 9 | pull-requests: write |
| 10 | |
| 11 | jobs: |
| 12 | benchmark: |
| 13 | runs-on: ubuntu-latest |
| 14 | steps: |
| 15 | - name: Check out code |
| 16 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 17 | with: |
| 18 | show-progress: false |
| 19 | |
| 20 | - name: Set up Go |
| 21 | uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 22 | with: |
| 23 | go-version-file: go.ver |
| 24 | cache: false |
| 25 | |
| 26 | - name: Fetch test rules |
| 27 | run: make -C cmd/pint/bench fetch |
| 28 | |
| 29 | - name: Benchmark PR branch |
| 30 | run: | |
| 31 | make benchmark | tee new.txt |
| 32 | |
| 33 | - name: Benchmark main branch |
| 34 | run: | |
| 35 | git fetch origin main |
| 36 | git reset --hard FETCH_HEAD |
| 37 | make benchmark | tee old.txt |
| 38 | |
| 39 | - name: Diff benchmarks |
| 40 | run: | |
| 41 | git reset --hard ${GITHUB_SHA} |
| 42 | make benchmark-diff |
| 43 | |
| 44 | - name: Report |
| 45 | if: ${{ github.event.pull_request.head.repo.full_name == 'cloudflare/pint' }} |
| 46 | uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1 |
| 47 | with: |
| 48 | file-path: benchstat.txt |
| 49 | comment-tag: benchstat |
| 50 | |