Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions .github/workflows/demo-recording.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Record Demos

on:
workflow_dispatch:
inputs:
pr_number:
description: "PR number to update with recordings (optional)"
required: false
type: string
demos:
description: "Which demos to record (space-separated, or leave blank for all)"
required: false
default: ""
type: string

concurrency:
group: demo-recording
cancel-in-progress: false

permissions:
contents: write
pull-requests: write

jobs:
record:
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
# If a PR number is provided, check out the PR branch so we can push back
ref: ${{ inputs.pr_number && format('refs/pull/{0}/head', inputs.pr_number) || github.ref }}
fetch-depth: 0

- name: Resolve PR branch name
if: inputs.pr_number != ''
id: pr-branch
run: |
BRANCH=$(gh pr view "${{ inputs.pr_number }}" --json headRefName -q '.headRefName')
echo "name=$BRANCH" >> "$GITHUB_OUTPUT"
git checkout "$BRANCH"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile

# Install recording dependencies
- name: Install recording tools
run: |
brew install tmux asciinema
brew install agg

# Install Lima for real VM creation
- name: Install Lima
run: brew install lima

# Build clawctl so the recording scripts can invoke it
- name: Build clawctl
run: bun run build:release

# Record demos
- name: Record demos
run: |
ARGS="${{ inputs.demos }}"
if [[ -n "$ARGS" ]]; then
./scripts/demos/record-all.sh $ARGS
else
./scripts/demos/record-all.sh
fi

# Convert the create demo to GIF for the README
- name: Generate README GIF
run: |
if [[ -f docs/assets/casts/create.cast ]]; then
agg --font-dir /Library/Fonts \
docs/assets/casts/create.cast \
docs/assets/demo.gif
fi

# Copy curated casts to the website public dir
- name: Update website casts
run: |
mkdir -p docs-site/public/casts
cp docs/assets/casts/*.cast docs-site/public/casts/ 2>/dev/null || true

# Upload all artifacts for download
- name: Upload recording artifacts
uses: actions/upload-artifact@v4
with:
name: demo-recordings
path: |
docs/assets/casts/*.cast
docs/assets/demo.gif
retention-days: 30

# Commit updated recordings back to the PR branch
- name: Commit updated recordings
if: inputs.pr_number != ''
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

git add docs/assets/demo.gif docs-site/public/casts/ || true

if git diff --cached --quiet; then
echo "No recording changes to commit"
else
git commit -m "chore: update demo recordings

Generated by demo-recording workflow run #${{ github.run_number }}"
git push origin "HEAD:${{ steps.pr-branch.outputs.name }}"
fi

# Post a comment on the PR linking the artifacts
- name: Comment on PR
if: inputs.pr_number != ''
uses: actions/github-script@v7
with:
script: |
const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const body = [
'## Demo Recordings Updated',
'',
'New recordings have been committed to this branch. Review the GIF diff in the commit above.',
'',
`[Download all recordings](${runUrl}) (workflow artifacts)`,
'',
`_Generated by [demo-recording workflow](${runUrl}) run #${context.runNumber}_`,
].join('\n');

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: parseInt('${{ inputs.pr_number }}'),
body,
});
44 changes: 44 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: E2E Tests

on:
workflow_dispatch:
inputs:
demos:
description: "Which demos to test (space-separated, or leave blank for all)"
required: false
default: ""
type: string
schedule:
# Weekly Monday 6:00 UTC — catch regressions from dependency updates
- cron: "0 6 * * 1"

concurrency:
group: e2e-tests
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
runs-on: macos-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile

- name: Install test dependencies
run: brew install tmux lima

- name: Build clawctl
run: bun run build:release

- name: Run E2E tests
run: |
ARGS="${{ inputs.demos }}"
if [[ -n "$ARGS" ]]; then
./scripts/demos/test-all.sh $ARGS
else
./scripts/demos/test-all.sh
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist/
.env
.env.secrets
*.cast
!docs-site/public/casts/*.cast
19 changes: 19 additions & 0 deletions docs-site/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"asciinema-player": "^3.15.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
Empty file added docs-site/public/casts/.gitkeep
Empty file.
Loading
Loading