name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 with:
toolchain: stable
- name: Install PCRE2
run: |
if [[ "${{ runner.os }}" == "macOS" ]]; then
brew install pcre2 pkg-config
else
sudo apt-get update
sudo apt-get install -y libpcre2-dev pkg-config
fi
- run: cargo fmt --check
- run: cargo test
- name: Verify generated completions
run: |
cargo run --features completion-generation --bin gen-completions
git diff --exit-code completions/
- name: Privacy scan
run: |
PATTERN='(/Users/[^[:space:]]+/(Desktop|Documents)|Desktop/[A-Za-z0-9_.-]+\.txt)'
if git grep -n -E "$PATTERN" -- . ':!Cargo.lock' ':!.github/workflows/ci.yml'; then
echo "Sensitive real-world capture marker found. Use synthetic fixtures instead."
exit 1
fi
- name: Verify Homebrew formula generator
run: |
tmp="$(mktemp -d)"
version="$(awk -F '"' '/^version = / { print $2; exit }' Cargo.toml)"
checksum="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
for target in darwin-aarch64 darwin-x86_64 linux-x86_64; do
printf '%s prismtty-%s-%s.tar.gz\n' "$checksum" "$version" "$target" > "$tmp/prismtty-${version}-${target}.tar.gz.sha256"
done
bash scripts/generate-homebrew-formula.sh "$tmp/prismtty.rb" "$tmp"
grep -F "version \"${version}\"" "$tmp/prismtty.rb"
grep -F 'depends_on "pcre2"' "$tmp/prismtty.rb"
grep -F "linux-x86_64" "$tmp/prismtty.rb"
if grep -n -E "REPLACE_WITH|linux-aarch64" "$tmp/prismtty.rb"; then
echo "Generated Homebrew formula has placeholder checksums or unsupported artifacts."
exit 1
fi
- run: cargo build --release