|
19 | 19 | with: |
20 | 20 | previewer-server: "https://pandas.pydata.org/preview" |
21 | 21 | artifact-job: "Doc Build and Upload" |
22 | | - asv_run: |
23 | | - runs-on: ubuntu-24.04 |
24 | | - # TODO: Support more benchmarking options later, against different branches, against self, etc |
25 | | - if: github.event.issue.pull_request && startsWith(github.event.comment.body, '@github-actions benchmark') |
26 | | - defaults: |
27 | | - run: |
28 | | - shell: bash -el {0} |
29 | | - env: |
30 | | - ENV_FILE: environment.yml |
31 | | - COMMENT: ${{github.event.comment.body}} |
32 | | - |
33 | | - concurrency: |
34 | | - # Set concurrency to prevent abuse(full runs are ~5.5 hours !!!) |
35 | | - # each user can only run one concurrent benchmark bot at a time |
36 | | - # We don't cancel in progress jobs, but if you want to benchmark multiple PRs, you're gonna have |
37 | | - # to wait |
38 | | - group: ${{ github.actor }}-asv |
39 | | - cancel-in-progress: false |
40 | | - |
41 | | - steps: |
42 | | - - name: Checkout |
43 | | - uses: actions/checkout@v5 |
44 | | - with: |
45 | | - fetch-depth: 0 |
46 | | - |
47 | | - # Although asv sets up its own env, deps are still needed |
48 | | - # during discovery process |
49 | | - - name: Set up Conda |
50 | | - uses: ./.github/actions/setup-conda |
51 | | - |
52 | | - - name: Run benchmarks |
53 | | - id: bench |
54 | | - continue-on-error: true # asv will exit code 1 for regressions |
55 | | - run: | |
56 | | - # extracting the regex, see https://stackoverflow.com/a/36798723 |
57 | | - REGEX=$(echo "$COMMENT" | sed -n "s/^.*-b\s*\(\S*\).*$/\1/p") |
58 | | - cd asv_bench |
59 | | - asv check -E existing |
60 | | - git remote add upstream https://github.com/pandas-dev/pandas.git |
61 | | - git fetch upstream |
62 | | - asv machine --yes |
63 | | - asv continuous -f 1.1 -b $REGEX upstream/main HEAD |
64 | | - echo 'BENCH_OUTPUT<<EOF' >> $GITHUB_ENV |
65 | | - asv compare -f 1.1 upstream/main HEAD >> $GITHUB_ENV |
66 | | - echo 'EOF' >> $GITHUB_ENV |
67 | | - echo "REGEX=$REGEX" >> $GITHUB_ENV |
68 | | -
|
69 | | - - uses: actions/github-script@v8 |
70 | | - env: |
71 | | - BENCH_OUTPUT: ${{env.BENCH_OUTPUT}} |
72 | | - REGEX: ${{env.REGEX}} |
73 | | - with: |
74 | | - script: | |
75 | | - const ENV_VARS = process.env |
76 | | - const run_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}` |
77 | | - github.rest.issues.createComment({ |
78 | | - issue_number: context.issue.number, |
79 | | - owner: context.repo.owner, |
80 | | - repo: context.repo.repo, |
81 | | - body: '\nBenchmarks completed. View runner logs here.' + run_url + '\nRegex used: '+ 'regex ' + ENV_VARS["REGEX"] + '\n' + ENV_VARS["BENCH_OUTPUT"] |
82 | | - }) |
0 commit comments