From 54b9f059df7829cc6c4e5472be5f1289564269f2 Mon Sep 17 00:00:00 2001 From: Niels Bauman Date: Sat, 20 Mar 2021 21:43:49 +0100 Subject: [PATCH] Run benchmarks in CI --- .github/workflows/cron-ci.yaml | 36 +++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cron-ci.yaml b/.github/workflows/cron-ci.yaml index 0b6bebdcc1..6524347ed6 100644 --- a/.github/workflows/cron-ci.yaml +++ b/.github/workflows/cron-ci.yaml @@ -118,4 +118,38 @@ jobs: cp ../whats_left.temp ./_data/whats_left.temp git add -A git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update what is left results" --author="$GITHUB_ACTOR" - git push \ No newline at end of file + git push + + benchmark: + name: Collect benchmark data + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: collect execution benchmark data + run: cargo bench --bench execution + - name: collect microbenchmarks data + run: cargo bench --bench microbenchmarks + - name: restructure generated files + run: | + cd ./target/criterion + find -type d -name cpython | xargs rm -rf + find -type d -name rustpython | xargs rm -rf + find -maxdepth 2 -type d -name report | xargs rm -rf + find -type f -not -name violin.svg | xargs rm -rf + for file in $(find -type f -name violin.svg); do mv $file $(echo $file | sed -E "s_\./([^/]+)/([^/]+)/report/violin\.svg_./\1/\2.svg_"); done + find -mindepth 2 -maxdepth 2 -type d | xargs rm -rf + - name: upload benchmark data to the website + env: + SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }} + run: | + echo "$SSHKEY" >~/github_key + chmod 600 ~/github_key + export GIT_SSH_COMMAND="ssh -i ~/github_key" + + git clone git@github.com:RustPython/rustpython.github.io.git website + cd website + rm -rf ./assets/criterion + cp -r ../target/criterion ./assets/criterion + git add ./assets/criterion + git -c user.name="Github Actions" -c user.email="actions@github.com" commit -m "Update benchmark results" + git push