-
Notifications
You must be signed in to change notification settings - Fork 42
90 lines (79 loc) · 3.3 KB
/
benchmarks.yml
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
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' }}
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.js
uses: actions/setup-node@v4
with:
node-version: 22.4.0
- 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 "esrlabs@gmail.com"
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