Benchmarks #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmarks | |
on: | |
workflow_dispatch: | |
inputs: | |
pr_id: | |
description: 'Pull Request number' | |
required: true | |
default: '' | |
workflow_run: | |
workflows: ["BuildAndReleaseMaster"] | |
types: | |
- completed | |
jobs: | |
invoke_jasmine_tests: | |
name: Invoke Jasmine performance tests | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} || ${{ github.event_name }}" == 'workflow_dispatch' | |
runs-on: self-hosted-runner-ubuntu | |
steps: | |
- name: Cleanup build folder | |
run: | | |
ls -la ./ | |
rm -rf ./* ./.??* || true | |
ls -la ./ | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: ./scripts/benchmarks/setup_dependencies.sh | |
- name: install node | |
uses: actions/setup-node@master | |
with: | |
node-version: "lts/*" | |
- name: Install Ruby and related tools | |
run: ./scripts/benchmarks/setup_dependencies.sh | |
- name: Install cargo tools | |
run: | | |
cargo install nj-cli wasm-pack --locked | |
npm install -g tslib | |
- name: Run Jasmine performance tests | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
export PATH="/root/.cargo/bin:$PATH" | |
source ~/.bashrc | |
if [[ "${{ github.event_name }}" == 'workflow_dispatch' && "${{ github.event.inputs.pr_id }}" -eq 0 ]]; then | |
echo "Running manually" | |
ruby scripts/benchmarks/process.rb 1 | |
elif [[ "${{ github.event_name }}" == 'workflow_dispatch' && "${{ github.event.inputs.pr_id }}" =~ ^[0-9]+$ ]]; then | |
ruby scripts/benchmarks/process.rb PR~${{ github.event.inputs.pr_id }} | |
elif [[ "${{ github.event_name }}" != 'workflow_dispatch' ]]; then | |
ruby scripts/benchmarks/process.rb 1 | |
fi | |
- name: List files in the results folder | |
run: 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 benchmark data | |
working-directory: ./chipmunk-docs | |
run: | | |
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" | |
if [[ "${{ github.event_name }}" == 'workflow_dispatch' && "${{ github.event.inputs.pr_id }}" -ne 0 ]]; then | |
cp /chipmunk/chipmunk_performance_results/Benchmark_PR_${{ github.event.inputs.pr_id }}.json ./jekyll/benchmarks/data/pull_request/ | |
git add ./jekyll/benchmarks/data/pull_request/Benchmark_PR_${{ github.event.inputs.pr_id }}.json | |
git commit -m "Adding PR benchmark results for chipmunk PR #${{ github.event.inputs.pr_id }}" | |
else | |
cp /chipmunk/chipmunk_performance_results/data.json ./jekyll/benchmarks/data/data.json | |
git add ./jekyll/benchmarks/data/data.json | |
git commit -m "Updating data.json for latest tag" | |
fi | |
git push origin master |