Skip to content

Update benchmarks.yml #101

Update benchmarks.yml

Update benchmarks.yml #101

Workflow file for this run

name: Benchmarks
on:
workflow_dispatch:
pull_request_target:
branches: [master]
workflow_run:
workflows: ["BuildAndReleaseMaster"]
types:
- completed
jobs:
invoke_jasmine_tests:
name: Invoke Jasmine performance tests
runs-on: self-hosted-runner-ubuntu
steps:
# - name: 'Cleanup build folder'
# run: |
# ls -la ./
# rm -rf ./* || true
# rm -rf ./.??* || true
# ls -la ./
# - name: Checkout
# uses: actions/checkout@v3
# - name: Install pre-requisite dependencies
# run: |
# sudo apt-get update && sudo apt-get install -y gconf-service libgbm-dev libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release xdg-utils wget ca-certificates
# sudo apt-get install -y libudev-dev cargo npm imagemagick libmagickwand-dev cmake
# - name: install node
# uses: actions/setup-node@v4
# with:
# node-version: 22.4.0
# - name: Install ruby and other related tools
# run: |
# whoami
# npm install -g corepack
# corepack enable
# curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
# echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# apt-get update
# sudo apt-get install -y yarn
# yarn --version
# apt update
# apt-get install -y software-properties-common
# apt-add-repository -y ppa:rael-gc/rvm
# apt-get update
# apt-get install -y rvm
# echo 'source "/etc/profile.d/rvm.sh"' >> ~/.bashrc
# source /etc/profile.d/rvm.sh
# which rvm
# rvm install ruby-3.1.2
# ruby --version
# sudo chown -R $(whoami) /usr/local
# rvm use 3.1.2 --default
# rvm --version
# rvm info
# which rvm
# ruby --version
# - name: cargo install nj-cli
# run: |
# cargo install nj-cli --locked
# cargo install wasm-pack --locked
# - name: Prepare environment
# run: |
# npm i -g tslib
# export PATH="/usr/share/rvm:$PATH"
# which ruby
# ruby --version
# pwd
# gem install dotenv json octokit tmpdir fileutils
# - name: Run Jasmine performance tests for the latest release
# if: github.event_name != 'pull_request'
# run: |
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# export PATH="/root/.cargo/bin:$PATH"
# . "/root/.cargo/env"
# source ~/.bashrc
# ruby scripts/tools/run_benchmarks.rb 1
# env:
# REPO_OWNER: 'esrlabs'
# REPO_NAME: 'chipmunk'
# - name: Run Jasmine performance tests for the latest pull request
# if: github.event_name == 'pull_request'
# run: |
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# export PATH="/root/.cargo/bin:$PATH"
# . "/root/.cargo/env"
# source ~/.bashrc
# echo "PR head repo: ${{ github.event.pull_request.head.repo.name }}"
# echo "PR head branch: ${{ github.event.pull_request.head.ref }}"
# echo "PR head owner: ${{ github.event.pull_request.head.repo.owner.login }}"
# ruby scripts/tools/run_benchmarks.rb PR~${{ github.event.pull_request.number }}
# env:
# REPO_OWNER: ${{ github.event.pull_request.head.repo.owner.login }}
# REPO_NAME: ${{ github.event.pull_request.head.repo.name }}
- name: List files in the results folder
run: |
echo "PR head owner is : ${{ github.actor }}"
echo "PR head owner: ${{ github.event.pull_request_target.head.repo.owner }}"
ls -la /chipmunk/chipmunk_performance_results
push_data_to_chipmunk_docs:
name: Move benchmark data to chipmunk-docs repository
needs: invoke_jasmine_tests
runs-on: self-hosted-runner-ubuntu
steps:
- name: Checkout chipmunk-docs repository
uses: actions/checkout@v2
with:
repository: esrlabs/chipmunk-docs
path: './chipmunk-docs'
token: ${{secrets.DOCS_PUSH_TOKEN}}
- name: Push tag for release
working-directory: ./chipmunk-docs
if: github.event_name != 'pull_request_target'
run: |
ls -la
cp /chipmunk/chipmunk_performance_results/data.json ./jekyll/benchmarks/data/data.json
git config user.name "esrlabs"
git config user.email "[email protected]"
git remote set-url origin "https://esrlabs:${{secrets.DOCS_PUSH_TOKEN}}@github.com/esrlabs/chipmunk-docs"
git add ./jekyll/benchmarks/data/data.json
git commit -m "Updating data.json for latest tag"
git push origin master
- name: Push PR data to chipmunk-docs
working-directory: ./chipmunk-docs
if: github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.owner.login == 'itsmesamster'
run: |
ls -la
cp /chipmunk/chipmunk_performance_results/Benchmark_PR_${{ github.event.pull_request.number }}.json ./jekyll/benchmarks/data/pull_request/Benchmark_PR_${{ github.event.pull_request.number }}.json
git config user.name "esrlabs"
git config user.email "[email protected]"
git remote set-url origin "https://esrlabs:${{secrets.DOCS_PUSH_TOKEN}}@github.com/esrlabs/chipmunk-docs"
git add ./jekyll/benchmarks/data/pull_request/Benchmark_PR_${{ github.event.pull_request.number }}.json
git commit -m "Adding PR benchmark results for chipmunk PR # ${{ github.event.pull_request.number }}"
git push origin master