Skip to content

Commit 54b9f05

Browse files
committed
Run benchmarks in CI
1 parent 7257785 commit 54b9f05

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

.github/workflows/cron-ci.yaml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,38 @@ jobs:
118118
cp ../whats_left.temp ./_data/whats_left.temp
119119
git add -A
120120
git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update what is left results" --author="$GITHUB_ACTOR"
121-
git push
121+
git push
122+
123+
benchmark:
124+
name: Collect benchmark data
125+
runs-on: ubuntu-latest
126+
steps:
127+
- uses: actions/checkout@master
128+
- name: collect execution benchmark data
129+
run: cargo bench --bench execution
130+
- name: collect microbenchmarks data
131+
run: cargo bench --bench microbenchmarks
132+
- name: restructure generated files
133+
run: |
134+
cd ./target/criterion
135+
find -type d -name cpython | xargs rm -rf
136+
find -type d -name rustpython | xargs rm -rf
137+
find -maxdepth 2 -type d -name report | xargs rm -rf
138+
find -type f -not -name violin.svg | xargs rm -rf
139+
for file in $(find -type f -name violin.svg); do mv $file $(echo $file | sed -E "s_\./([^/]+)/([^/]+)/report/violin\.svg_./\1/\2.svg_"); done
140+
find -mindepth 2 -maxdepth 2 -type d | xargs rm -rf
141+
- name: upload benchmark data to the website
142+
env:
143+
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
144+
run: |
145+
echo "$SSHKEY" >~/github_key
146+
chmod 600 ~/github_key
147+
export GIT_SSH_COMMAND="ssh -i ~/github_key"
148+
149+
git clone git@github.com:RustPython/rustpython.github.io.git website
150+
cd website
151+
rm -rf ./assets/criterion
152+
cp -r ../target/criterion ./assets/criterion
153+
git add ./assets/criterion
154+
git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update benchmark results"
155+
git push

0 commit comments

Comments
 (0)