Repository navigation
71 lines (67 loc) · 2.2 KB
/
Copy pathstack.yml
File metadata and controls
71 lines (67 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: stack
on:
schedule:
- cron: '*/5 * * * *'
workflow_dispatch:
push:
branches: [main]
paths: ['stack/**', '.github/workflows/stack.yml', 'pnpm-workspace.yaml', 'package.json']
concurrency:
group: stack
cancel-in-progress: false
permissions:
contents: write
jobs:
stack:
runs-on: ubuntu-latest
timeout-minutes: 55
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 50
- uses: pnpm/action-setup@v4
with:
version: 12
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- id: day
run: echo "day=$(date -u +%F)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
with:
path: .stack-mirror
key: stack-mirror-${{ steps.day.outputs.day }}
restore-keys: stack-mirror-
- name: Install the pi coding agent
run: npm install -g @mariozechner/pi-coding-agent@0.73.1
- name: Rebuild the PR stacks
id: build
env:
GH_TOKEN: ${{ github.token }}
ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }}
ZAI_MODEL: ${{ vars.ZAI_MODEL }}
run: |
git config user.name 'bot-harness stack'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
before=$(git rev-parse HEAD)
node stack/build.ts
echo "changed=$([ "$before" = "$(git rev-parse HEAD)" ] && echo false || echo true)" >> "$GITHUB_OUTPUT"
- name: Refresh the lockfile
if: steps.build.outputs.changed == 'true'
run: |
pnpm install --lockfile-only --ignore-scripts
if ! git diff --quiet -- pnpm-lock.yaml; then
git add pnpm-lock.yaml
git commit -q -m 'stack: refresh pnpm-lock.yaml for the new package manifests'
fi
- name: Install, typecheck and load every package
if: steps.build.outputs.changed == 'true'
run: |
pnpm install --frozen-lockfile
pnpm typecheck
node stack/smoke.ts
- name: Push
if: steps.build.outputs.changed == 'true'
run: |
git push origin HEAD:main || { git pull --rebase origin main && git push origin HEAD:main; }