Skip to content

Commit 7644976

Browse files
authored
Reduce pull request GitHub Actions load (#28)
* ci: trim pull request workflow load * ci: split pr and main workflows
1 parent 4ae1831 commit 7644976

3 files changed

Lines changed: 78 additions & 4 deletions

File tree

.github/workflows/benchmarks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Benchmarks
22

33
on:
4-
pull_request:
4+
push:
5+
branches:
6+
- master
57
workflow_dispatch:
68

79
concurrency:

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
name: CI
1+
name: Main CI
22

33
on:
44
push:
55
branches:
66
- master
7-
pull_request:
87

98
concurrency:
10-
group: ci-${{ github.workflow }}-${{ github.ref }}
9+
group: main-ci-${{ github.workflow }}-${{ github.ref }}
1110
cancel-in-progress: true
1211

1312
jobs:

.github/workflows/pr-ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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

Comments
 (0)