Skip to content

Commit 93ba783

Browse files
authored
Merge pull request paperclipai#1331 from paperclipai/ci/consolidate-pr-workflows
ci: consolidate PR workflows into a single file
2 parents ebe0035 + 2fdf953 commit 93ba783

4 files changed

Lines changed: 146 additions & 166 deletions

File tree

.github/workflows/pr-e2e.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

.github/workflows/pr-policy.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/pr-verify.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/pr.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
concurrency:
9+
group: pr-${{ github.event.pull_request.number }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
policy:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 5
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Block manual lockfile edits
24+
if: github.head_ref != 'chore/refresh-lockfile'
25+
run: |
26+
changed="$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}")"
27+
if printf '%s\n' "$changed" | grep -qx 'pnpm-lock.yaml'; then
28+
echo "Do not commit pnpm-lock.yaml in pull requests. CI owns lockfile updates."
29+
exit 1
30+
fi
31+
32+
- name: Setup pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
version: 9.15.4
36+
run_install: false
37+
38+
- name: Setup Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 24
42+
43+
- name: Validate dependency resolution when manifests change
44+
run: |
45+
changed="$(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}")"
46+
manifest_pattern='(^|/)package\.json$|^pnpm-workspace\.yaml$|^\.npmrc$|^pnpmfile\.(cjs|js|mjs)$'
47+
if printf '%s\n' "$changed" | grep -Eq "$manifest_pattern"; then
48+
pnpm install --lockfile-only --ignore-scripts --no-frozen-lockfile
49+
fi
50+
51+
verify:
52+
needs: [policy]
53+
runs-on: ubuntu-latest
54+
timeout-minutes: 20
55+
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- name: Setup pnpm
61+
uses: pnpm/action-setup@v4
62+
with:
63+
version: 9.15.4
64+
65+
- name: Setup Node.js
66+
uses: actions/setup-node@v4
67+
with:
68+
node-version: 24
69+
cache: pnpm
70+
71+
- name: Install dependencies
72+
run: pnpm install --frozen-lockfile
73+
74+
- name: Typecheck
75+
run: pnpm -r typecheck
76+
77+
- name: Run tests
78+
run: pnpm test:run
79+
80+
- name: Build
81+
run: pnpm build
82+
83+
- name: Release canary dry run
84+
run: |
85+
git checkout -B master HEAD
86+
git checkout -- pnpm-lock.yaml
87+
./scripts/release.sh canary --skip-verify --dry-run
88+
89+
e2e:
90+
needs: [policy]
91+
runs-on: ubuntu-latest
92+
timeout-minutes: 30
93+
94+
steps:
95+
- name: Checkout repository
96+
uses: actions/checkout@v4
97+
98+
- name: Setup pnpm
99+
uses: pnpm/action-setup@v4
100+
with:
101+
version: 9.15.4
102+
103+
- name: Setup Node.js
104+
uses: actions/setup-node@v4
105+
with:
106+
node-version: 24
107+
cache: pnpm
108+
109+
- name: Install dependencies
110+
run: pnpm install --frozen-lockfile
111+
112+
- name: Build
113+
run: pnpm build
114+
115+
- name: Install Playwright
116+
run: npx playwright install --with-deps chromium
117+
118+
- name: Generate Paperclip config
119+
run: |
120+
mkdir -p ~/.paperclip/instances/default
121+
cat > ~/.paperclip/instances/default/config.json << 'CONF'
122+
{
123+
"$meta": { "version": 1, "updatedAt": "2026-01-01T00:00:00.000Z", "source": "onboard" },
124+
"database": { "mode": "embedded-postgres" },
125+
"logging": { "mode": "file" },
126+
"server": { "deploymentMode": "local_trusted", "host": "127.0.0.1", "port": 3100 },
127+
"auth": { "baseUrlMode": "auto" },
128+
"storage": { "provider": "local_disk" },
129+
"secrets": { "provider": "local_encrypted", "strictMode": false }
130+
}
131+
CONF
132+
133+
- name: Run e2e tests
134+
env:
135+
PAPERCLIP_E2E_SKIP_LLM: "true"
136+
run: pnpm run test:e2e
137+
138+
- name: Upload Playwright report
139+
uses: actions/upload-artifact@v4
140+
if: always()
141+
with:
142+
name: playwright-report
143+
path: |
144+
tests/e2e/playwright-report/
145+
tests/e2e/test-results/
146+
retention-days: 14

0 commit comments

Comments
 (0)