File: benchmark.yml

package info (click to toggle)
httpie 3.2.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,904 kB
  • sloc: python: 13,760; xml: 162; makefile: 141; ruby: 79; sh: 32
file content (52 lines) | stat: -rw-r--r-- 1,429 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Benchmark

on:
  pull_request:
    types: [ labeled ]

permissions:
  issues: write
  pull-requests: write

jobs:
  test:
    if: github.event.label.name == 'benchmark'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: "3.9"

      - id: benchmarks
        name: Run Benchmarks
        run: |
          python -m pip install pyperf>=2.3.0
          python extras/profiling/run.py --fresh --complex  --min-speed=6 --file output.txt
          body=$(cat output.txt)
          body="${body//'%'/'%25'}"
          body="${body//$'\n'/'%0A'}"
          body="${body//$'\r'/'%0D'}"
          echo "::set-output name=body::$body"

      - name: Find Comment
        uses: peter-evans/find-comment@v2
        id: fc
        with:
          issue-number: ${{ github.event.pull_request.number }}
          comment-author: 'github-actions[bot]'
          body-includes: '# Benchmarks'

      - name: Create or update comment
        uses: peter-evans/create-or-update-comment@v2
        with:
          comment-id: ${{ steps.fc.outputs.comment-id }}
          issue-number: ${{ github.event.pull_request.number }}
          body: |
            # Benchmarks
            ${{ steps.benchmarks.outputs.body }}
          edit-mode: replace

      - uses: actions-ecosystem/action-remove-labels@v1
        with:
          labels: benchmark