diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-07 00:07:24 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-07 16:29:44 +0300 |
| commit | 3c2b46d24aa6c8011a1e198143752f2aa414d585 (patch) | |
| tree | a52280bccc824ca656f8bc986a756f30901974e4 /.github/workflows | |
| parent | 5d7e56737ef30d9de5802b0684a9428c40131dda (diff) | |
feat: add native windows beta support
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/build-artifacts-manual.yml | 53 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 76 |
2 files changed, 129 insertions, 0 deletions
diff --git a/.github/workflows/build-artifacts-manual.yml b/.github/workflows/build-artifacts-manual.yml index 7096c6c5..369d72ff 100644 --- a/.github/workflows/build-artifacts-manual.yml +++ b/.github/workflows/build-artifacts-manual.yml @@ -11,6 +11,7 @@ on: options: - linux - macos + - windows - all libghostty_optimize: description: libghostty-vt optimize mode for this build @@ -179,3 +180,55 @@ jobs: ${{ matrix.name }} BUILD_INFO.txt retention-days: 7 + + build-windows: + if: ${{ inputs.build_group == 'windows' || inputs.build_group == 'all' }} + runs-on: windows-latest + env: + LIBGHOSTTY_VT_OPTIMIZE: ${{ inputs.libghostty_optimize }} + LIBGHOSTTY_VT_SIMD: ${{ inputs.libghostty_simd }} + + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-msvc + + - name: Install Zig + uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 + with: + version: 0.15.2 + + - name: Remove Zig caches + shell: pwsh + run: | + Remove-Item -Recurse -Force .zig-cache -ErrorAction SilentlyContinue + Remove-Item -Recurse -Force vendor/libghostty-vt/.zig-cache -ErrorAction SilentlyContinue + Remove-Item -Recurse -Force vendor/libghostty-vt/zig-out -ErrorAction SilentlyContinue + + - name: Build + run: cargo build --release --locked --target x86_64-pc-windows-msvc + + - name: Package artifact + shell: pwsh + run: | + Copy-Item target\x86_64-pc-windows-msvc\release\herdr.exe herdr-windows-x86_64.exe + "commit=$env:GITHUB_SHA" | Out-File -Encoding utf8 BUILD_INFO.txt + "target=x86_64-pc-windows-msvc" | Out-File -Encoding utf8 -Append BUILD_INFO.txt + "libghostty_vt_optimize=$env:LIBGHOSTTY_VT_OPTIMIZE" | Out-File -Encoding utf8 -Append BUILD_INFO.txt + "libghostty_vt_simd=$env:LIBGHOSTTY_VT_SIMD" | Out-File -Encoding utf8 -Append BUILD_INFO.txt + $hash = (Get-FileHash -Algorithm SHA256 herdr-windows-x86_64.exe).Hash.ToLowerInvariant() + "sha256=$hash herdr-windows-x86_64.exe" | Out-File -Encoding utf8 -Append BUILD_INFO.txt + + - name: Upload artifact + uses: actions/upload-artifact@v7 + with: + name: herdr-windows-x86_64-${{ inputs.libghostty_optimize }}-simd-${{ inputs.libghostty_simd }} + path: | + herdr-windows-x86_64.exe + BUILD_INFO.txt + retention-days: 7 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcd0d1ba..448f204e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,3 +76,79 @@ jobs: - name: Run checks run: just ci '${{ matrix.nextest_filter }}' + + check-windows: + name: check (windows) + runs-on: windows-latest + timeout-minutes: 15 + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-msvc + + - name: Install Rust tools + uses: taiki-e/install-action@b550161ef8a7bc4f2a671c0b03a18ac9ccedea1e # v2 + with: + tool: cargo-nextest + + - name: Install Zig + uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 + with: + version: 0.15.2 + + - name: Restore cargo cache + uses: Swatinem/rust-cache@v2 + with: + cache-bin: false + key: windows-x86_64-pc-windows-msvc + + - name: Run Windows checks + shell: pwsh + run: | + cargo fmt --check + cargo clippy --bin herdr --locked --target x86_64-pc-windows-msvc -- -D warnings + cargo nextest run --locked --target x86_64-pc-windows-msvc -E "binary(herdr)" --status-level fail --final-status-level slow --failure-output final --success-output never + cargo build --locked --target x86_64-pc-windows-msvc + + - name: Smoke ConPTY pane + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + $env:HERDR_SESSION = "ci-windows-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT" + $exe = Join-Path $PWD "target\x86_64-pc-windows-msvc\debug\herdr.exe" + + & $exe --version + & $exe --default-config | Out-Null + + $server = Start-Process -FilePath $exe -ArgumentList "server" -PassThru -WindowStyle Hidden + try { + $deadline = (Get-Date).AddSeconds(10) + do { + Start-Sleep -Milliseconds 250 + $status = & $exe status server 2>&1 + if ($LASTEXITCODE -eq 0 -and (($status -join "`n") -match "status: running")) { + break + } + } while ((Get-Date) -lt $deadline) + + if ((Get-Date) -ge $deadline) { + throw "server did not become ready" + } + + & $exe agent start smoke -- "$env:ComSpec" /K dir + Start-Sleep -Seconds 2 + $read = & $exe agent read smoke --source recent --lines 40 --format text + $text = $read -join "`n" + if ($text -notmatch "Directory of") { + throw "pane read did not include cmd.exe directory output: $text" + } + } finally { + & $exe server stop 2>$null + Wait-Process -Id $server.Id -Timeout 10 -ErrorAction SilentlyContinue + } |
