-
-
Notifications
You must be signed in to change notification settings - Fork 0
186 lines (156 loc) · 4.42 KB
/
asv_test.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Run ASV
on:
pull_request:
branches:
- main
schedule:
- cron: "20 * * * *"
env:
ENV_FILE: environment.yml
PANDAS_CI: 1
BRANCH_NAME: test
permissions:
contents: read
jobs:
check-new-commit:
name: Check Latest Commit
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -el {0}
outputs:
new_commit: ${{ steps.new-commit.outputs.new_commit }}
steps:
- name: Checkout pandas
uses: actions/checkout@v4
with:
repository: pandas-dev/pandas
- name: Checkout asv-runner results branch
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
path: asv-runner/
- name: Compare Commit SHAs
id: new-commit
run: |
latest_benchmarked=
if [ "$(git rev-parse HEAD)" = "$(cat data/latest_sha.txt)" ]; then
echo "new_commit=no" >> "$GITHUB_OUTPUT"
else
echo "new_commit=yes" >> "$GITHUB_OUTPUT"
fi
produce-asv-benchmarks:
needs: check-new-commit
if: ${{ needs.check-new-commit.outputs.new_commit == 'yes' }}
name: ASV Benchmarks
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout pandas
uses: actions/checkout@v4
with:
repository: pandas-dev/pandas
fetch-depth: 0
- name: Show files
run: |
ls -l
ls -l asv_bench/
- name: Checkout asv-runner results branch
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
path: asv-runner/
- name: Move html directory
run: |
mv asv-runner/docs/ asv_bench/html
- name: Show files
run: |
ls -l
ls -l asv_bench/
- name: Set up Conda
uses: ./.github/actions/setup-conda
- name: Build pandas
uses: ./.github/actions/build_pandas
- name: Run ASV Benchmarks
run: |
cd asv_bench
asv machine --machine=asvrunner --yes
asv run --machine=asvrunner --python=same --set-commit-hash=$(git rev-parse HEAD) -b ^groupby.GroupByCythonAgg
asv publish
# Move to a standard location
mv results/asvrunner/$(git rev-parse --short=8 HEAD)*.json results.json
git rev-parse HEAD > latest_sha.txt
- name: Save JSON results as an artifact
uses: actions/upload-artifact@v4
with:
name: results.json
path: asv_bench/results.json
retention-days: 14
- name: Save html directory as an artifact
uses: actions/upload-artifact@v4
with:
name: html
path: asv_bench/html/
- name: Save latest_sha.txt as an artifact
uses: actions/upload-artifact@v4
with:
name: latest_sha.txt
path: latest_sha.txt
process-asv-benchmarks:
name: Process ASV Benchmarks
needs: [check-new-commit, produce-asv-benchmarks]
if: ${{ needs.check-new-commit.outputs.new_commit == 'yes' }}
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -el {0}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Upgrade build dependencies
run: pip install -U pip
- name: Install dependencies
run: pip install pandas pyarrow
- name: Download results.json
uses: actions/download-artifact@v4
with:
name: results.json
- name: Download html
uses: actions/download-artifact@v4
with:
name: html
path: docs/
- name: Download latest_sha.txt
uses: actions/download-artifact@v4
with:
name: latest_sha.txt
path: data/latest_sha.txt
- name: Show files
run: ls -l
- name: Show files 3
run: ls -l data/
- name: Process ASV results
run: |
python ci/process_results.py
- name: Save parquet results as an artifact
uses: actions/upload-artifact@v4
with:
name: results.parquet
path: data/results.parquet
retention-days: 14
- name: Commit results
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Results
branch: ${{ env.BRANCH_NAME }}
file_pattern: 'data/ docs/'