@@ -11,18 +11,83 @@ permissions:
11
11
jobs :
12
12
issue_assign :
13
13
runs-on : ubuntu-22.04
14
+ if : (!github.event.issue.pull_request) && github.event.comment.body == 'take'
15
+ concurrency :
16
+ group : ${{ github.actor }}-issue-assign
14
17
steps :
15
- - if : (!github.event.issue.pull_request) && github.event.comment.body == 'take'
16
- run : |
17
- echo "Assigning issue ${{ github.event.issue.number }} to ${{ github.event.comment.user.login }}"
18
- curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees
18
+ - run : |
19
+ echo "Assigning issue ${{ github.event.issue.number }} to ${{ github.event.comment.user.login }}"
20
+ curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees
19
21
preview_docs :
20
22
runs-on : ubuntu-22.04
23
+ if : github.event.issue.pull_request && github.event.comment.body == '/preview'
24
+ concurrency :
25
+ group : ${{ github.actor }}-preview-docs
21
26
steps :
22
- - if : github.event.issue.pull_request && github.event.comment.body == '/preview'
23
- run : |
24
- if curl --output /dev/null --silent --head --fail "https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"; then
25
- curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "Website preview of this PR available at: https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
26
- else
27
- curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "No preview found for PR #${{ github.event.issue.number }}. Did the docs build complete?"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
28
- fi
27
+ - run : |
28
+ if curl --output /dev/null --silent --head --fail "https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"; then
29
+ curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "Website preview of this PR available at: https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
30
+ else
31
+ curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "No preview found for PR #${{ github.event.issue.number }}. Did the docs build complete?"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments
32
+ fi
33
+ asv_run :
34
+ runs-on : ubuntu-22.04
35
+ # TODO: Support more benchmarking options later, against different branches, against self, etc
36
+ if : github.event.issue.pull_request && startsWith(github.event.comment.body, '@github-actions benchmark')
37
+ defaults :
38
+ run :
39
+ shell : bash -el {0}
40
+ env :
41
+ ENV_FILE : environment.yml
42
+ COMMENT : ${{github.event.comment.body}}
43
+
44
+ concurrency :
45
+ # Set concurrency to prevent abuse(full runs are ~5.5 hours !!!)
46
+ # each user can only run one concurrent benchmark bot at a time
47
+ # We don't cancel in progress jobs, but if you want to benchmark multiple PRs, you're gonna have
48
+ # to wait
49
+ group : ${{ github.actor }}-asv
50
+ cancel-in-progress : false
51
+
52
+ steps :
53
+ - name : Checkout
54
+ uses : actions/checkout@v3
55
+ with :
56
+ fetch-depth : 0
57
+
58
+ # Although asv sets up its own env, deps are still needed
59
+ # during discovery process
60
+ - name : Set up Conda
61
+ uses : ./.github/actions/setup-conda
62
+
63
+ - name : Run benchmarks
64
+ id : bench
65
+ continue-on-error : true # asv will exit code 1 for regressions
66
+ run : |
67
+ # extracting the regex, see https://stackoverflow.com/a/36798723
68
+ REGEX=$(echo "$COMMENT" | sed -n "s/^.*-b\s*\(\S*\).*$/\1/p")
69
+ cd asv_bench
70
+ asv check -E existing
71
+ git remote add upstream https://github.com/pandas-dev/pandas.git
72
+ git fetch upstream
73
+ asv machine --yes
74
+ asv continuous -f 1.1 -b $REGEX upstream/main HEAD
75
+ echo 'BENCH_OUTPUT<<EOF' >> $GITHUB_ENV
76
+ asv compare -f 1.1 upstream/main HEAD >> $GITHUB_ENV
77
+ echo 'EOF' >> $GITHUB_ENV
78
+ echo "REGEX=$REGEX" >> $GITHUB_ENV
79
+
80
+ - uses : actions/github-script@v6
81
+ env :
82
+ BENCH_OUTPUT : ${{env.BENCH_OUTPUT}}
83
+ REGEX : ${{env.REGEX}}
84
+ with :
85
+ script : |
86
+ const ENV_VARS = process.env
87
+ const run_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
88
+ github.rest.issues.createComment({
89
+ issue_number: context.issue.number,
90
+ owner: context.repo.owner,
91
+ repo: context.repo.repo,
92
+ body: '\nBenchmarks completed. View runner logs here.' + run_url + '\nRegex used: '+ 'regex ' + ENV_VARS["REGEX"] + '\n' + ENV_VARS["BENCH_OUTPUT"]
93
+ })
0 commit comments