Rename runtime branding from bun to poly #25
This file contains hidden or 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: Bun integration build | |
| on: | |
| pull_request: | |
| paths: | |
| - ".github/workflows/bun-integration.yml" | |
| - ".github/workflows/release.yml" | |
| - "Cargo.lock" | |
| - "Cargo.toml" | |
| - "bun.lock" | |
| - "package.json" | |
| - "poly/**" | |
| - "scripts/**" | |
| - "src/**" | |
| workflow_call: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| BUN_VERSION: "1.3.2" | |
| CARGO_INCREMENTAL: "0" | |
| LLVM_VERSION_MAJOR: "21" | |
| RUSTUP_TOOLCHAIN: nightly-2026-07-20 | |
| jobs: | |
| build: | |
| name: Build and smoke-test ${{ matrix.platform }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 90 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux-x64 | |
| os: ubuntu-24.04 | |
| artifact_path: dist/poly | |
| - platform: windows-x64 | |
| # The pinned Bun/WebKit toolchain targets the VS 2022 MSVC ABI. | |
| os: windows-2022 | |
| artifact_path: dist/poly.exe | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Install Linux build dependencies | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | | |
| sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc >/dev/null | |
| codename="$(lsb_release -cs)" | |
| echo \ | |
| "deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${LLVM_VERSION_MAJOR} main" | | |
| sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq --no-install-recommends \ | |
| clang-${LLVM_VERSION_MAJOR} \ | |
| cmake \ | |
| curl \ | |
| golang \ | |
| libffi-dev \ | |
| liblzma-dev \ | |
| libtool \ | |
| lld-${LLVM_VERSION_MAJOR} \ | |
| llvm-${LLVM_VERSION_MAJOR} \ | |
| ninja-build \ | |
| pkg-config \ | |
| ruby-full \ | |
| software-properties-common \ | |
| unzip \ | |
| wget \ | |
| xz-utils | |
| - name: Install Windows build dependencies | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: ./poly/scripts/setup-bun-windows-ci.ps1 | |
| - name: Install Bun's Rust toolchain | |
| shell: bash | |
| run: | | |
| rustup toolchain install "$RUSTUP_TOOLCHAIN" --profile minimal | |
| rustup override set "$RUSTUP_TOOLCHAIN" | |
| - name: Build Poly from the fork source tree | |
| shell: pwsh | |
| run: ./poly/scripts/build.ps1 -Configuration Release | |
| - name: Upload executable | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: poly-${{ matrix.platform }} | |
| path: ${{ matrix.artifact_path }} | |
| if-no-files-found: error | |
| retention-days: 7 | |
| - name: Configure Windows crash dumps | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $dumpDir = Join-Path $env:RUNNER_TEMP "poly-crash-dumps" | |
| New-Item -ItemType Directory -Force -Path $dumpDir | Out-Null | |
| "POLY_CRASH_DUMP_DIR=$dumpDir" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| $werKey = "HKCU:\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\poly.exe" | |
| New-Item -Force -Path $werKey | Out-Null | |
| New-ItemProperty -Force -Path $werKey -Name DumpFolder -PropertyType ExpandString -Value $dumpDir | Out-Null | |
| New-ItemProperty -Force -Path $werKey -Name DumpType -PropertyType DWord -Value 2 | Out-Null | |
| - name: Smoke-test direct Python entry | |
| shell: pwsh | |
| run: | | |
| $poly = if ($IsWindows) { ".\dist\poly.exe" } else { "./dist/poly" } | |
| & $poly poly/examples/python_main.py -- workflow | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "Direct Python smoke test failed with exit code $LASTEXITCODE." | |
| } | |
| - name: Smoke-test JavaScript runtime | |
| shell: pwsh | |
| env: | |
| POLY_TRACE: "1" | |
| run: | | |
| $poly = if ($IsWindows) { ".\dist\poly.exe" } else { "./dist/poly" } | |
| & $poly poly/examples/js_smoke.ts | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "JavaScript smoke test failed with exit code $LASTEXITCODE." | |
| } | |
| - name: Smoke-test TypeScript to Python | |
| shell: pwsh | |
| env: | |
| POLY_TRACE: "1" | |
| run: | | |
| $poly = if ($IsWindows) { ".\dist\poly.exe" } else { "./dist/poly" } | |
| & $poly poly/examples/main.ts | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "TypeScript to Python smoke test failed with exit code $LASTEXITCODE." | |
| } | |
| - name: Smoke-test Shell entry (Bun Shell, in-process) | |
| shell: pwsh | |
| run: | | |
| $poly = if ($IsWindows) { ".\dist\poly.exe" } else { "./dist/poly" } | |
| & $poly poly/examples/shell_demo.sh | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "Shell smoke test failed with exit code $LASTEXITCODE." | |
| } | |
| - name: Smoke-test SQL entry (in-memory SQLite) | |
| shell: pwsh | |
| run: | | |
| $poly = if ($IsWindows) { ".\dist\poly.exe" } else { "./dist/poly" } | |
| & $poly poly/examples/sql_demo.sql | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "SQL smoke test failed with exit code $LASTEXITCODE." | |
| } | |
| - name: Smoke-test C entry (embedded TinyCC) | |
| shell: pwsh | |
| run: | | |
| $poly = if ($IsWindows) { ".\dist\poly.exe" } else { "./dist/poly" } | |
| & $poly poly/examples/c_demo.c | |
| if ($LASTEXITCODE -ne 7) { | |
| throw "C smoke test failed with exit code $LASTEXITCODE." | |
| } | |
| # The runner appends `exit $LASTEXITCODE` to pwsh steps, and a | |
| # dot-sourced `exit 7` exits 1, so reset the code after the check | |
| # passes or the step fails despite poly returning 7. | |
| $LASTEXITCODE = 0 | |
| - name: Smoke-test unified REPL (Shell / SQL / C mode switching) | |
| shell: pwsh | |
| run: | | |
| $poly = if ($IsWindows) { ".\dist\poly.exe" } else { "./dist/poly" } | |
| $input = @( | |
| ".sh", | |
| "echo repl-shell-ok", | |
| ".sql", | |
| "SELECT 42 AS x", | |
| ".c", | |
| 'printf("repl-c-ok\n");', | |
| ".exit" | |
| ) | |
| $output = $input | & $poly repl 2>&1 | Out-String | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "REPL smoke test failed with exit code $LASTEXITCODE." | |
| } | |
| # The SQL result renders as a JSON string, so the column name's | |
| # quotes are escaped (`\"x\":42`), and `-match` is a regex. | |
| if (-not ($output -match "repl-shell-ok" -and $output -match '\\"x\\":42' -and $output -match "repl-c-ok")) { | |
| throw "REPL smoke test output missing expected results." | |
| } | |
| - name: Upload Windows crash diagnostics | |
| if: failure() && runner.os == 'Windows' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: poly-windows-crash-diagnostics | |
| path: ${{ env.POLY_CRASH_DUMP_DIR }} | |
| if-no-files-found: warn | |
| retention-days: 7 |