diff --git a/.tangled/workflows/build-bench.yaml b/.tangled/workflows/build-bench.yaml new file mode 100644 index 000000000..ba75d6442 --- /dev/null +++ b/.tangled/workflows/build-bench.yaml @@ -0,0 +1,24 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build benchmarks + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build -Demit-bench diff --git a/.tangled/workflows/build-cmake-and-examples.yaml b/.tangled/workflows/build-cmake-and-examples.yaml new file mode 100644 index 000000000..e9fc6f182 --- /dev/null +++ b/.tangled/workflows/build-cmake-and-examples.yaml @@ -0,0 +1,55 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +dependencies: +- jq +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build cmake package + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + nix develop -c cmake -B build + nix develop -c cmake --build build + test -f zig-out/lib/libghostty-vt.so.0.1.0 + test -d zig-out/include/ghostty + ls -la zig-out/lib/ + ls -la zig-out/include/ghostty/ +- name: build zig examples + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + while IFS= read -r zon; do + dir="$(dirname "$zon")" + echo "== zig example ${dir} ==" + (cd "$dir" && nix develop -c zig build) + done < <(find example -mindepth 2 -maxdepth 2 -name build.zig.zon | sort) +- name: build cmake examples + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + while IFS= read -r cmakelists; do + dir="$(dirname "$cmakelists")" + echo "== cmake example ${dir} ==" + nix develop -c cmake -B "${dir}/build" -DFETCHCONTENT_SOURCE_DIR_GHOSTTY="$PWD" "$dir" + nix develop -c cmake --build "${dir}/build" + done < <(find example -mindepth 2 -maxdepth 2 -name CMakeLists.txt | sort) diff --git a/.tangled/workflows/build-dist-lib-vt.yaml b/.tangled/workflows/build-dist-lib-vt.yaml new file mode 100644 index 000000000..f802e1bc5 --- /dev/null +++ b/.tangled/workflows/build-dist-lib-vt.yaml @@ -0,0 +1,34 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build and check lib-vt source tarball + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + rm -rf zig-out/dist + nix develop -c zig build distcheck -Demit-lib-vt=true + tarball=$(ls zig-out/dist/*.tar.gz) + size=$(stat --format=%s "$tarball") + max=$((5 * 1024 * 1024)) + echo "Tarball size: $size bytes (max: $max)" + if [ "$size" -gt "$max" ]; then + echo "ERROR: tarball exceeds 5 MB" + exit 1 + fi diff --git a/.tangled/workflows/build-dist.yaml b/.tangled/workflows/build-dist.yaml new file mode 100644 index 000000000..2441851ab --- /dev/null +++ b/.tangled/workflows/build-dist.yaml @@ -0,0 +1,28 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build and check source tarball + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + rm -rf zig-out/dist + nix develop -c zig build distcheck + cp zig-out/dist/*.tar.gz ghostty-source.tar.gz + ls -lh ghostty-source.tar.gz diff --git a/.tangled/workflows/build-flatpak-snap.yaml b/.tangled/workflows/build-flatpak-snap.yaml new file mode 100644 index 000000000..34a11b53c --- /dev/null +++ b/.tangled/workflows/build-flatpak-snap.yaml @@ -0,0 +1,30 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build flatpak mode + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build -Dflatpak +- name: build snap mode + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build -Dsnap diff --git a/.tangled/workflows/build-libghostty-vt-android.yaml b/.tangled/workflows/build-libghostty-vt-android.yaml new file mode 100644 index 000000000..03390c979 --- /dev/null +++ b/.tangled/workflows/build-libghostty-vt-android.yaml @@ -0,0 +1,35 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache + ANDROID_NDK_VERSION: r29 +steps: +- name: build libghostty-vt android targets + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + : "${ANDROID_NDK_HOME:?set ANDROID_NDK_HOME to an unpacked Android NDK; upstream used nttld/setup-ndk}" + targets=( + aarch64-linux-android + x86_64-linux-android + arm-linux-androideabi + ) + for target in "${targets[@]}"; do + echo "== android target=${target} ==" + nix develop -c zig build -Demit-lib-vt -Dtarget="${target}" + done diff --git a/.tangled/workflows/build-libghostty-vt-targets.yaml b/.tangled/workflows/build-libghostty-vt-targets.yaml new file mode 100644 index 000000000..d2d42d548 --- /dev/null +++ b/.tangled/workflows/build-libghostty-vt-targets.yaml @@ -0,0 +1,37 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build libghostty-vt target matrix + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + targets=( + aarch64-macos + x86_64-macos + aarch64-linux + x86_64-linux + x86_64-linux-musl + x86_64-windows-gnu + wasm32-freestanding + ) + for target in "${targets[@]}"; do + echo "== target=${target} ==" + nix develop -c zig build -Demit-lib-vt -Dtarget="${target}" + done diff --git a/.tangled/workflows/build-linux-libghostty.yaml b/.tangled/workflows/build-linux-libghostty.yaml new file mode 100644 index 000000000..40701a3bc --- /dev/null +++ b/.tangled/workflows/build-linux-libghostty.yaml @@ -0,0 +1,24 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build libghostty without app runtime + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build -Dapp-runtime=none diff --git a/.tangled/workflows/build-linux.yaml b/.tangled/workflows/build-linux.yaml new file mode 100644 index 000000000..e5ed120bd --- /dev/null +++ b/.tangled/workflows/build-linux.yaml @@ -0,0 +1,24 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build linux + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build diff --git a/.tangled/workflows/build-nix.yaml b/.tangled/workflows/build-nix.yaml new file mode 100644 index 000000000..6ab5cf175 --- /dev/null +++ b/.tangled/workflows/build-nix.yaml @@ -0,0 +1,62 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build ghostty releasefast package + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + nix build .#ghostty-releasefast + result/bin/ghostty +version | grep -q '.ReleaseFast' + nm result/bin/.ghostty-wrapped 2>&1 | grep -q 'no symbols' +- name: build ghostty debug package + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + nix build .#ghostty-debug + result/bin/ghostty +version | grep -q '.Debug' + nm result/bin/.ghostty-wrapped 2>&1 | grep -q 'main_ghostty.main' +- name: build libghostty-vt nix packages + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + variants=( + libghostty-vt-releasefast + libghostty-vt-releasefast-no-simd + libghostty-vt-debug + libghostty-vt-debug-no-simd + ) + tests=( + sanity-check + pkg-config + build-with-shared + build-with-static + build-example-c-vt-build-info + ) + for variant in "${variants[@]}"; do + echo "== ${variant} ==" + nix build ".#${variant}" + for test in "${tests[@]}"; do + nix build ".#${variant}.tests.${test}" + done + done diff --git a/.tangled/workflows/debian-13-docker-build.yaml b/.tangled/workflows/debian-13-docker-build.yaml new file mode 100644 index 000000000..f4a587691 --- /dev/null +++ b/.tangled/workflows/debian-13-docker-build.yaml @@ -0,0 +1,42 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +dependencies: +- docker +- docker-buildx +virtualisation: + docker: + enable: true +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build source tarball + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + rm -rf zig-out/dist dist ghostty-source.tar.gz + nix develop -c zig build distcheck + cp zig-out/dist/*.tar.gz ghostty-source.tar.gz + mkdir dist + tar --verbose --extract --strip-components 1 --directory dist --file ghostty-source.tar.gz +- name: build debian 13 docker image + command: | + set -euo pipefail + docker info + docker buildx version + tag="debian-13-sha-${TANGLED_SHA:-local}" + docker buildx build --load --build-arg DISTRO_VERSION=13 --file dist/src/build/docker/debian/Dockerfile --tag "ghostty:${tag}" dist diff --git a/.tangled/workflows/lint-format.yaml b/.tangled/workflows/lint-format.yaml new file mode 100644 index 000000000..5ee33ddd9 --- /dev/null +++ b/.tangled/workflows/lint-format.yaml @@ -0,0 +1,73 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: zig fmt check + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig fmt --check . +- name: pinact check + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c pinact run --check +- name: prettier check + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c prettier --check . +- name: alejandra check + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c alejandra --check . +- name: typos check + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c typos +- name: shellcheck + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + nix develop -c shellcheck \ + --check-sourced \ + --color=always \ + --severity=warning \ + $(find . \( -name "*.sh" -o -name "*.bash" \) -type f ! -path "./zig-out/*" ! -path "./macos/build/*" ! -path "./.git/*" | sort) +- name: check translations + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c .github/scripts/check-translations.sh +- name: check blueprints + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + nix develop -c ./nix/build-support/check-blueprints.sh + git diff --exit-code diff --git a/.tangled/workflows/nix-check-zig-cache-hash.yaml b/.tangled/workflows/nix-check-zig-cache-hash.yaml new file mode 100644 index 000000000..2756ff6ae --- /dev/null +++ b/.tangled/workflows/nix-check-zig-cache-hash.yaml @@ -0,0 +1,24 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: check zig cache hash + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c ./nix/build-support/check-zig-cache.sh diff --git a/.tangled/workflows/release-source-tarball-local.yaml b/.tangled/workflows/release-source-tarball-local.yaml new file mode 100644 index 000000000..067606738 --- /dev/null +++ b/.tangled/workflows/release-source-tarball-local.yaml @@ -0,0 +1,58 @@ +when: +- event: + - manual +- event: + - push + tag: + - v[0-9]+.[0-9]+.[0-9]+ +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: derive version and build metadata + command: | + set -euo pipefail + version="${GHOSTTY_VERSION:-}" + if [ -z "$version" ]; then + ref="${TANGLED_REF:-}" + version="${ref##*/}" + fi + if [[ ! "$version" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "set GHOSTTY_VERSION=vX.Y.Z or run from a matching tag" + exit 1 + fi + version="${version#v}" + build="$(git rev-list --count HEAD || echo 0)" + commit="$(git rev-parse --short HEAD)" + echo "GHOSTTY_VERSION=${version}" + echo "GHOSTTY_BUILD=${build}" + echo "GHOSTTY_COMMIT=${commit}" +- name: create release source tarball + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + rm -rf zig-out/dist + nix develop -c zig build distcheck + cp zig-out/dist/*.tar.gz ghostty-source.tar.gz + ls -lh ghostty-source.tar.gz +- name: optionally sign source tarball + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + if [ -n "${MINISIGN_KEY:-}" ] && [ -n "${MINISIGN_PASSWORD:-}" ]; then + printf '%s' "$MINISIGN_KEY" > minisign.key + printf '%s' "$MINISIGN_PASSWORD" > minisign.password + nix develop -c minisign -S -m ghostty-source.tar.gz -s minisign.key < minisign.password + ls -lh ghostty-source.tar.gz.minisig + else + echo "MINISIGN_KEY/MINISIGN_PASSWORD not set; skipping signature" + fi diff --git a/.tangled/workflows/test-feature-matrix.yaml b/.tangled/workflows/test-feature-matrix.yaml new file mode 100644 index 000000000..6c2bc58ad --- /dev/null +++ b/.tangled/workflows/test-feature-matrix.yaml @@ -0,0 +1,48 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: test simd on/off + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + for simd in true false; do + echo "== simd=${simd} ==" + nix develop -c zig build test -Dsimd="${simd}" + done +- name: test sentry on/off + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + for sentry in true false; do + echo "== sentry=${sentry} ==" + nix develop -c zig build -Dsentry="${sentry}" + done +- name: test i18n on/off + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + for i18n in true false; do + echo "== i18n=${i18n} ==" + nix develop -c zig build -Di18n="${i18n}" + done diff --git a/.tangled/workflows/test-fuzz-libghostty.yaml b/.tangled/workflows/test-fuzz-libghostty.yaml new file mode 100644 index 000000000..530c4b255 --- /dev/null +++ b/.tangled/workflows/test-fuzz-libghostty.yaml @@ -0,0 +1,39 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +dependencies: +- aflplusplus +- llvmPackages_18.llvm +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: verify afl and llvm + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + afl-cc --version + if command -v llvm-config >/dev/null 2>&1; then + llvm-config --version + else + llvm-config-18 --version + fi +- name: build fuzzer harness + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c sh -c 'cd test/fuzz-libghostty && zig build' diff --git a/.tangled/workflows/test-gtk-matrix.yaml b/.tangled/workflows/test-gtk-matrix.yaml new file mode 100644 index 000000000..f2fa0445c --- /dev/null +++ b/.tangled/workflows/test-gtk-matrix.yaml @@ -0,0 +1,31 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: test gtk x11/wayland combinations + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + for x11 in true false; do + for wayland in true false; do + echo "== gtk x11=${x11} wayland=${wayland} ==" + nix develop -c zig build -Dapp-runtime=gtk -Dgtk-x11="${x11}" -Dgtk-wayland="${wayland}" test + nix develop -c zig build -Dapp-runtime=gtk -Dgtk-x11="${x11}" -Dgtk-wayland="${wayland}" + done + done diff --git a/.tangled/workflows/test-lib-vt-pkgconfig.yaml b/.tangled/workflows/test-lib-vt-pkgconfig.yaml new file mode 100644 index 000000000..becf703a2 --- /dev/null +++ b/.tangled/workflows/test-lib-vt-pkgconfig.yaml @@ -0,0 +1,37 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: build libghostty-vt + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build -Demit-lib-vt +- name: verify pkg-config file + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + nix develop -c sh -c ' + export PKG_CONFIG_PATH="$PWD/zig-out/share/pkgconfig" + pkg-config --validate libghostty-vt + echo "Cflags: $(pkg-config --cflags libghostty-vt)" + echo "Libs: $(pkg-config --libs libghostty-vt)" + echo "Static: $(pkg-config --libs --static libghostty-vt)" + ' diff --git a/.tangled/workflows/test-lib-vt.yaml b/.tangled/workflows/test-lib-vt.yaml new file mode 100644 index 000000000..b59091b01 --- /dev/null +++ b/.tangled/workflows/test-lib-vt.yaml @@ -0,0 +1,24 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: test libghostty-vt + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build test-lib-vt diff --git a/.tangled/workflows/test-linux.yaml b/.tangled/workflows/test-linux.yaml new file mode 100644 index 000000000..5301d11dc --- /dev/null +++ b/.tangled/workflows/test-linux.yaml @@ -0,0 +1,36 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: test app-runtime none + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build -Dapp-runtime=none test +- name: test gtk build + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build -Dapp-runtime=gtk -Demit-docs -Demit-webdata +- name: test system build + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build --system "$ZIG_GLOBAL_CACHE_DIR/p" diff --git a/.tangled/workflows/test-pkg-linux.yaml b/.tangled/workflows/test-pkg-linux.yaml new file mode 100644 index 000000000..c100561ff --- /dev/null +++ b/.tangled/workflows/test-pkg-linux.yaml @@ -0,0 +1,24 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: test pkg/wuffs build + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c sh -c 'cd pkg/wuffs ; zig build test' diff --git a/.tangled/workflows/update-colorschemes-local.yaml b/.tangled/workflows/update-colorschemes-local.yaml new file mode 100644 index 000000000..491e93f16 --- /dev/null +++ b/.tangled/workflows/update-colorschemes-local.yaml @@ -0,0 +1,48 @@ +when: +- event: + - manual +- event: + - push + branch: + - main +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +dependencies: +- curl +- jq +- gh +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: download latest iTerm2 color schemes + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + : "${GH_TOKEN:?set GH_TOKEN for gh api access}" + RELEASE_INFO=$(gh api repos/mbadolato/iTerm2-Color-Schemes/releases/latest) + TAG_NAME=$(echo "$RELEASE_INFO" | jq -r '.tag_name') + FILENAME="ghostty-themes-${TAG_NAME}.tgz" + mkdir -p upload + curl -L -o "upload/${FILENAME}" "https://github.com/mbadolato/iTerm2-Color-Schemes/releases/download/${TAG_NAME}/ghostty-themes.tgz" + echo "tag_name=$TAG_NAME" + echo "filename=$FILENAME" +- name: update zig package lock/cache files + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + + FILENAME=$(basename upload/ghostty-themes-*.tgz) + nix develop -c zig fetch --save="iterm2_themes" "https://deps.files.ghostty.org/${FILENAME}" + if ! git diff --exit-code build.zig.zon; then + nix develop -c ./nix/build-support/check-zig-cache.sh --update + nix develop -c ./nix/build-support/check-zig-cache.sh + fi + nix build .#ghostty + git diff -- build.zig.zon build.zig.zon.nix build.zig.zon.txt build.zig.zon.json flatpak/zig-packages.json || true diff --git a/.tangled/workflows/valgrind.yaml b/.tangled/workflows/valgrind.yaml new file mode 100644 index 000000000..d96080583 --- /dev/null +++ b/.tangled/workflows/valgrind.yaml @@ -0,0 +1,32 @@ +when: +- event: + - pull_request +- event: + - push + branch: + - '**' + tag: + - '**' +engine: microvm +clone: + depth: 1 +caches: + "https://ghostty.cachix.org": "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" +dependencies: +- valgrind +environment: + ZIG_LOCAL_CACHE_DIR: /workspace/.zig/local-cache + ZIG_GLOBAL_CACHE_DIR: /workspace/.zig/global-cache +steps: +- name: verify valgrind + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + valgrind --version +- name: run valgrind tests + command: | + set -euo pipefail + mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR" + nix --version + nix develop -c zig build test-valgrind