|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +concurrency: |
| 7 | + group: pr-ci-${{ github.workflow }}-${{ github.ref }} |
| 8 | + cancel-in-progress: true |
| 9 | + |
| 10 | +jobs: |
| 11 | + pr-validate: |
| 12 | + name: Typecheck + Test + Smoke |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Check out repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Set up Bun |
| 19 | + uses: oven-sh/setup-bun@v2 |
| 20 | + with: |
| 21 | + bun-version: 1.3.10 |
| 22 | + |
| 23 | + - name: Set up Node |
| 24 | + uses: actions/setup-node@v4 |
| 25 | + with: |
| 26 | + node-version: 22 |
| 27 | + |
| 28 | + - name: Install dependencies |
| 29 | + run: bun install --frozen-lockfile |
| 30 | + |
| 31 | + - name: Typecheck |
| 32 | + run: bun run typecheck |
| 33 | + |
| 34 | + - name: Test suite |
| 35 | + run: bun test |
| 36 | + |
| 37 | + - name: Verify terminal tools |
| 38 | + run: | |
| 39 | + command -v script |
| 40 | + command -v timeout |
| 41 | +
|
| 42 | + - name: TTY smoke tests |
| 43 | + run: bun run test:tty-smoke |
| 44 | + |
| 45 | + - name: Build npm runtime bundle |
| 46 | + run: bun run build:npm |
| 47 | + |
| 48 | + - name: Verify npm pack output |
| 49 | + run: bun run check:pack |
| 50 | + |
| 51 | + - name: Simulate global npm install |
| 52 | + run: | |
| 53 | + pkg_dir="$(mktemp -d)" |
| 54 | + install_dir="$(mktemp -d)" |
| 55 | + node_dir="$(dirname "$(command -v node)")" |
| 56 | + npm pack --pack-destination "$pkg_dir" >/dev/null |
| 57 | + pkg="$(find "$pkg_dir" -maxdepth 1 -name 'hunkdiff-*.tgz' | head -n1)" |
| 58 | + npm install -g --prefix "$install_dir" "$pkg" |
| 59 | + PATH="$install_dir/bin:$node_dir:/usr/bin:/bin" |
| 60 | + if command -v bun >/dev/null 2>&1; then |
| 61 | + echo "bun unexpectedly available on the sanitized PATH" >&2 |
| 62 | + exit 1 |
| 63 | + fi |
| 64 | + hunk --help | grep 'Usage: hunk' |
| 65 | +
|
| 66 | + - name: Stage prebuilt npm packages |
| 67 | + run: bun run build:prebuilt:npm |
| 68 | + |
| 69 | + - name: Verify staged prebuilt packs |
| 70 | + run: bun run check:prebuilt-pack |
| 71 | + |
| 72 | + - name: Smoke test prebuilt global install |
| 73 | + run: bun run smoke:prebuilt-install |
0 commit comments