-
-
Notifications
You must be signed in to change notification settings - Fork 0
249 lines (240 loc) Β· 7.53 KB
/
build.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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
name: Build Project
on:
push:
branches: [ master, ver/* ]
pull_request:
branches: [ master, ver/* ]
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-24.04
timeout-minutes: 20
name: Gradle Setup
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Set up Konan
uses: actions/cache@v4
with:
path: |
~/.konan/caches
~/.konan/dependencies
~/.konan/kotlin-native-prebuilt-linux-*
key: ${{ runner.os }}-konan-${{ hashFiles('**/Dependencies.kt') }}
restore-keys: |
${{ runner.os }}-konan-
- name: Change Permissions
run: chmod +x ./gradlew
- name: Gradle Information
run: ./gradlew project tasks dependencies
benchmark:
runs-on: ${{ matrix.os }}
needs: setup
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
include:
- name: linux
os: ubuntu-24.04
- name: macos
os: macos-13
- name: windows
os: windows-2025
name: Benchmark on ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
# OS Configuration
- name: MacOS Configuration
if: ${{ matrix.name == 'macos' }}
run: |
# Link GCC and G++ to GCC-14
ln -sf "$(brew --prefix gcc@14)/bin/gcc-14" /usr/local/bin/gcc
ln -sf "$(brew --prefix gcc@14)/bin/g++-14" /usr/local/bin/g++
- name: Linux Configuration
if: ${{ matrix.name == 'linux' }}
run: |
# Increase Swap Space
sudo swapoff -a
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
# Setup Tasks
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Set up Konan
uses: actions/cache@v4
with:
path: |
~/.konan/caches
~/.konan/dependencies
~/.konan/kotlin-native-prebuilt-${{ matrix.name }}-*
key: ${{ runner.os }}-konan-${{ hashFiles('**/Dependencies.kt') }}
restore-keys: |
${{ runner.os }}-konan
# Start Daemon
- name: Change Permissions
run: chmod +x ./gradlew
- name: Gradle Information
run: ./gradlew project tasks dependencies
# Runtimes
- name: Install JavaScript (Node)
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install JavaScript (Node) Dependencies
run: |
cd benchmarks
npm install
cd ..
- name: Install JavaScript (Deno)
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Install JavaScript (Deno) Dependencies
run: |
cd benchmarks
deno install
cd ..
- name: Install JavaScript (Bun)
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install JavaScript (Bun) Dependencies
run: |
cd benchmarks
bun install
cd ..
- name: Install Kotlin
uses: gmitch215/setup-kotlin@main
with:
version: '2.1.0'
install-native: true
- name: Install Unix Kotlin/Native Dependencies
if: ${{ matrix.name != 'windows' }}
run: bash benchmarks/kotlinc-native-dependencies.sh
- name: Install Windows Kotlin/Native Dependencies
if: ${{ matrix.name == 'windows' }}
run: benchmarks/kotlinc-native-dependencies.bat
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.23.3'
cache: 'false'
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install Python Dependencies
run: pip install -r benchmarks/requirements.txt
- name: Install PHP
uses: shivammathur/setup-php@v2
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: 'false'
- name: Install Zig
uses: mlugg/setup-zig@v1
# Benchmarking
- name: Install Libraries
run: ./gradlew downloadLibraries
- name: Cache Compile Binaries
uses: actions/cache@v4
with:
path: benchmarks/**/*.{o,exe,kexe,jar,pdb,class}
key: ${{ runner.os }}-compile-${{ hashFiles('benchmarks/**/*', 'lib/**/*') }}
restore-keys: |
${{ runner.os }}-compile-
- name: Create Benchmarks
run: ./gradlew benchmark
- name: Upload Benchmarks
uses: actions/upload-artifact@v4
with:
name: benchmarks-${{ matrix.name }}
path: benchmarks/output
overwrite: true
- name: Stop Gradle
run: ./gradlew --stop
site:
runs-on: ubuntu-latest
needs: benchmark
timeout-minutes: 20
name: Site Generation
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
working-directory: site
- name: Change Permissions
run: chmod +x ./gradlew
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
pattern: benchmarks-*
path: build/site/_data/results/
- name: Rename Folders
run: |
mv -fv build/site/_data/results/benchmarks-linux build/site/_data/results/linux
mv -fv build/site/_data/results/benchmarks-macos build/site/_data/results/mac
mv -fv build/site/_data/results/benchmarks-windows build/site/_data/results/windows
- name: Generate Site
run: ./gradlew site
- name: Build Site
run: |
cd build/site
bundle exec jekyll build
cd ../..
- name: Archive Site
uses: actions/upload-artifact@v4
with:
name: site
path: build/site/_site
- name: Calculate Previous Site Revision
id: prev-run
run: echo "PREVIOUS_RUN_ID=$((${{ github.run_id }} - 1))" >> "$GITHUB_OUTPUT"
- name: Download Previous Site
uses: actions/download-artifact@v4
with:
name: site
path: build/old_site
run-id: ${{ steps.prev-run.outputs.PREVIOUS_RUN_ID }}
- name: Remove Duplicate Files
run: bash .github/remove_duplicates.sh build/old_site/site build/site/_site
- name: Upload Site
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ secrets.CF_R2_ACCESS_KEY }}
aws_secret_access_key: ${{ secrets.CF_R2_SECRET_ACCESS_KEY }}
aws_bucket: ${{ vars.CF_R2_BUCKET }}
endpoint: ${{ secrets.CF_R2_ENDPOINT }}
source_dir: 'build/site/_site'
destination_dir: ''