Skip to content

Add nodal system

Add nodal system #49

Workflow file for this run

name: ⏱ Benchmarks
on:
pull_request:
types: [opened, synchronize, labeled]
jobs:
benchmark:
if: contains(github.event.pull_request.labels.*.name, 'CI/Benchmarks')
strategy:
matrix:
job:
- name: master
ref: master
- name: pr
ref: ${{ github.head_ref }}
name: Benchmark on ${{ matrix.job.ref }}
runs-on: ubuntu-latest
env:
DISPLAY: ':99.0'
steps:
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libasound2-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev
- name: Xvfb
run: |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- name: Checkout ${{ matrix.job.ref }}
uses: actions/checkout@v4
with:
ref: ${{ matrix.job.ref }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Run benchmarks on ${{ matrix.job.ref }}
run: go test -run='^$' -bench=. -count=10 test/benchmarks_test.go | grep -v "XGB:" > /tmp/benchmarks-${{ matrix.job.name }}.txt
- name: Archive benchmark results
uses: actions/upload-artifact@v4
with:
name: benchmarks-${{ matrix.job.name }}
path: /tmp/benchmarks-${{ matrix.job.name }}.txt
Benchstat:
runs-on: ubuntu-latest
needs: benchmark
steps:
- name: Download master benchmark
uses: actions/download-artifact@v4
with:
name: benchmarks-master
- name: Download PR benchmark
uses: actions/download-artifact@v4
with:
name: benchmarks-pr
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Setup benchstat
run: go install golang.org/x/perf/cmd/benchstat@latest
- name: Run benchmarks diff
id: benchmarks-diff
run: benchstat benchmarks-master.txt benchmarks-pr.txt > benchmarks-diff.txt
- name: Prepare output
id: prepare-output
run: |
echo "master<<EOF" >> "$GITHUB_OUTPUT"
cat benchmarks-master.txt >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
echo "pr<<EOF" >> "$GITHUB_OUTPUT"
cat benchmarks-pr.txt >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
echo "diff<<EOF" >> "$GITHUB_OUTPUT"
cat benchmarks-diff.txt >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
- name: Comment PR with benchmark results
uses: thollander/actions-comment-pull-request@v2
with:
message: |
## Benchmarks
#### Benchstat `master` vs `${{ github.head_ref }}`
<details>
<summary>Results</summary>
```
${{ steps.prepare-output.outputs.diff }}
```
</details>
#### Benchmarks on `${{ github.head_ref }}`
<details>
<summary>Results</summary>
```
${{ steps.prepare-output.outputs.pr }}
```
</details>
#### Benchmarks on `master`
<details>
<summary>Results</summary>
```
${{ steps.prepare-output.outputs.master }}
```
</details>
comment_tag: benchmarks