Switch to R2 Hosting #157
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 90 | |
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: 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 --info | |
- 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: Upload Site | |
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' |