2022-06-25 09:30:26 +08:00
|
|
|
name: benchmark
|
|
|
|
|
2022-06-14 23:48:07 +08:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- "docs/**"
|
|
|
|
- "papers/**"
|
|
|
|
- "rfcs/**"
|
|
|
|
- "*.md"
|
|
|
|
- "prototyping/**"
|
|
|
|
|
|
|
|
jobs:
|
2022-07-05 02:13:07 +08:00
|
|
|
callgrind:
|
|
|
|
name: callgrind ${{ matrix.compiler }}
|
2022-06-14 23:48:07 +08:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-07-05 02:13:07 +08:00
|
|
|
os: [ubuntu-22.04]
|
|
|
|
compiler: [g++]
|
2022-06-14 23:48:07 +08:00
|
|
|
benchResultsRepo:
|
|
|
|
- { name: "luau-lang/benchmark-data", branch: "main" }
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2022-06-25 00:46:29 +08:00
|
|
|
- name: Checkout Luau repository
|
2022-06-14 23:48:07 +08:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2022-06-25 00:46:29 +08:00
|
|
|
- name: Install valgrind
|
|
|
|
run: |
|
|
|
|
sudo apt-get install valgrind
|
|
|
|
|
|
|
|
- name: Build Luau
|
2022-07-05 02:13:07 +08:00
|
|
|
run: CXX=${{ matrix.compiler }} make config=release CALLGRIND=1 luau
|
2022-06-25 00:46:29 +08:00
|
|
|
|
2022-07-05 02:13:07 +08:00
|
|
|
- name: Run benchmark
|
2022-06-25 00:46:29 +08:00
|
|
|
run: |
|
2022-07-05 02:13:07 +08:00
|
|
|
python bench/bench.py --callgrind --vm "./luau -O2" | tee output.txt
|
2022-06-25 00:46:29 +08:00
|
|
|
|
2022-07-05 02:13:07 +08:00
|
|
|
- name: Checkout benchmark results
|
2022-06-25 00:46:29 +08:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: ${{ matrix.benchResultsRepo.name }}
|
|
|
|
ref: ${{ matrix.benchResultsRepo.branch }}
|
|
|
|
token: ${{ secrets.BENCH_GITHUB_TOKEN }}
|
|
|
|
path: "./gh-pages"
|
|
|
|
|
2022-07-05 02:13:07 +08:00
|
|
|
- name: Store results
|
2022-06-25 00:46:29 +08:00
|
|
|
uses: Roblox/rhysd-github-action-benchmark@v-luau
|
|
|
|
with:
|
2022-07-05 02:13:07 +08:00
|
|
|
name: callgrind ${{ matrix.compiler }}
|
2022-06-25 00:46:29 +08:00
|
|
|
tool: "benchmarkluau"
|
2022-07-05 02:13:07 +08:00
|
|
|
output-file-path: ./output.txt
|
|
|
|
external-data-json-path: ./gh-pages/bench/data.json
|
2022-06-25 00:46:29 +08:00
|
|
|
|
|
|
|
- name: Push benchmark results
|
|
|
|
if: github.event_name == 'push'
|
2022-06-14 23:48:07 +08:00
|
|
|
run: |
|
|
|
|
echo "Pushing benchmark results..."
|
|
|
|
cd gh-pages
|
|
|
|
git config user.name github-actions
|
|
|
|
git config user.email github@users.noreply.github.com
|
2022-07-05 02:13:07 +08:00
|
|
|
git add ./bench/data.json
|
2022-06-14 23:48:07 +08:00
|
|
|
git commit -m "Add benchmarks results for ${{ github.sha }}"
|
|
|
|
git push
|
|
|
|
cd ..
|