-
Notifications
You must be signed in to change notification settings - Fork 1
143 lines (118 loc) · 4.13 KB
/
benchmarks.yml
File metadata and controls
143 lines (118 loc) · 4.13 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Benchmarks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: # Allow manual trigger
env:
CARGO_TERM_COLOR: always
jobs:
benchmark-linux:
name: Benchmark (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential libreadline-dev unzip
- name: Extract Lua source
run: |
cd lua_src
unzip -o lua-5.4.8.zip
- name: Build and Install Native Lua from source
run: |
cd lua_src/lua-5.4.8
make linux
sudo make install INSTALL_TOP=/usr/local
echo "/usr/local/bin" >> $GITHUB_PATH
- name: Verify Lua installation
run: |
which lua
lua -v
- name: Build Release
run: cargo build --release
- name: Run Benchmarks
run: |
echo "## Benchmark Results - Linux (ubuntu-latest)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
chmod +x run_benchmarks.sh
./run_benchmarks.sh --nocolor 2>&1 | tee -a $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
benchmark-windows:
name: Benchmark (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Extract Lua source
shell: pwsh
run: |
cd lua_src
Expand-Archive -Path lua-5.4.8.zip -DestinationPath . -Force
- name: Build Native Lua with CMake
shell: pwsh
run: |
cd lua_src/lua-5.4.8
cmake -B build -DCMAKE_BUILD_TYPE=Release -DLUA_BUILD_INTERPRETER=ON
cmake --build build --config Release
# Add to PATH for this job
$luaPath = "$PWD\build\Release"
echo "$luaPath" >> $env:GITHUB_PATH
# Also copy to a known location
New-Item -ItemType Directory -Force -Path "$env:GITHUB_WORKSPACE\lua_bin"
Copy-Item "build\Release\lua.exe" "$env:GITHUB_WORKSPACE\lua_bin\"
- name: Verify Lua installation
shell: pwsh
run: |
$env:PATH = "$env:GITHUB_WORKSPACE\lua_bin;$env:PATH"
& "$env:GITHUB_WORKSPACE\lua_bin\lua.exe" -v
- name: Build Release
run: cargo build --release
- name: Run Benchmarks
shell: pwsh
run: |
$env:PATH = "$env:GITHUB_WORKSPACE\lua_bin;$env:PATH"
echo "## Benchmark Results - Windows (windows-latest)" >> $env:GITHUB_STEP_SUMMARY
echo "" >> $env:GITHUB_STEP_SUMMARY
echo '```' >> $env:GITHUB_STEP_SUMMARY
# Use the lua we built
$env:NATIVE_LUA = "$env:GITHUB_WORKSPACE\lua_bin\lua.exe"
.\run_benchmarks.ps1 -NoColor 2>&1 | Tee-Object -Append -FilePath $env:GITHUB_STEP_SUMMARY
echo '```' >> $env:GITHUB_STEP_SUMMARY
benchmark-macos:
name: Benchmark (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install build dependencies
run: brew install readline
- name: Extract Lua source
run: |
cd lua_src
unzip -o lua-5.4.8.zip
- name: Build and Install Native Lua from source
run: |
cd lua_src/lua-5.4.8
make macosx
sudo make install INSTALL_TOP=/usr/local
echo "/usr/local/bin" >> $GITHUB_PATH
- name: Verify Lua installation
run: |
which lua
lua -v
- name: Build Release
run: cargo build --release
- name: Run Benchmarks
run: |
echo "## Benchmark Results - macOS (macos-latest)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
chmod +x run_benchmarks.sh
./run_benchmarks.sh --nocolor 2>&1 | tee -a $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY