-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (79 loc) · 2.79 KB
/
demos.yml
File metadata and controls
91 lines (79 loc) · 2.79 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Regenerate Demos
on:
push:
paths:
- 'cli/**'
- 'scripts/demos/**'
workflow_dispatch:
permissions:
contents: read
jobs:
demos:
name: Record and Render Demos
runs-on: ubuntu-latest
env:
AGG_VERSION: 1.7.0
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'cli/go.mod'
cache-dependency-path: cli/go.sum
- name: Build ddx binary
run: |
cd cli
go build -o ../bin/ddx .
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Install asciinema
run: pip install asciinema
- name: Install agg
run: |
curl -fsSL https://github.com/asciinema/agg/releases/download/v${AGG_VERSION}/agg-x86_64-unknown-linux-gnu \
-o /usr/local/bin/agg
chmod +x /usr/local/bin/agg
- name: Validate existing casts
run: bash scripts/demos/validate-casts.sh
- name: Record demo scripts
env:
GIT_TEMPLATE_DIR: ""
run: |
mkdir -p demos
# Record mechanical demos (01-05) — no agent required
for script in scripts/demos/0[1-5]*.sh; do
name=$(basename "$script" .sh)
echo "Recording $name..."
asciinema rec --cols 80 --rows 24 --command "bash $script" "demos/${name}.cast" || true
done
# 07-quickstart records at 100x30
echo "Recording 07-quickstart..."
asciinema rec --cols 100 --rows 30 --command "bash scripts/demos/07-quickstart.sh" "demos/07-quickstart.cast" || true
# 06-full-journey requires agent access — skip in standard CI
echo "Skipping 06-full-journey (requires agent access)."
- name: Render GIFs
run: |
for cast in demos/*.cast; do
agg "$cast" "${cast%.cast}.gif"
done
- name: Check for changes vs repo
run: |
{
echo "## Demo Recordings"
echo ""
if git diff --quiet -- demos/ 2>/dev/null && ! git ls-files --others --exclude-standard demos/ | grep -q .; then
echo "No changes detected in demo recordings vs repository."
else
echo "Demo recordings differ from what is stored in the repository."
echo "Download the artifacts from this run to update them."
echo ""
echo "Changed/new files:"
git diff --name-only -- demos/ 2>/dev/null || true
git ls-files --others --exclude-standard demos/ 2>/dev/null || true
fi
} >> $GITHUB_STEP_SUMMARY
- name: Upload demo artifacts
uses: actions/upload-artifact@v4
with:
name: demos
path: demos/
retention-days: 30