← back to Cli Printing Press
ci: add catalog validation pipeline for PRs
97ff74ff46657b59407e929666b607316db96ea6 · 2026-03-23 16:17:43 -0700 · Matt Van Horn
Files touched
A .github/workflows/validate-catalog.yml
Diff
commit 97ff74ff46657b59407e929666b607316db96ea6
Author: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Date: Mon Mar 23 16:17:43 2026 -0700
ci: add catalog validation pipeline for PRs
---
.github/workflows/validate-catalog.yml | 70 ++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
diff --git a/.github/workflows/validate-catalog.yml b/.github/workflows/validate-catalog.yml
new file mode 100644
index 00000000..f6f4dcb2
--- /dev/null
+++ b/.github/workflows/validate-catalog.yml
@@ -0,0 +1,70 @@
+name: Validate Catalog
+
+on:
+ pull_request:
+ paths:
+ - 'catalog/**'
+
+jobs:
+ validate:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-go@v5
+ with:
+ go-version: '1.22'
+
+ - name: Build printing-press
+ run: go build -o ./printing-press ./cmd/printing-press
+
+ - name: Validate catalog schemas
+ run: go test ./internal/catalog/... -v
+
+ - name: Validate changed catalog entries
+ run: |
+ for file in $(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD -- 'catalog/*.yaml'); do
+ echo "=== Validating $file ==="
+
+ # Extract spec_url
+ SPEC_URL=$(grep 'spec_url:' "$file" | sed 's/spec_url: *//')
+
+ # Verify HTTPS
+ if [[ ! "$SPEC_URL" =~ ^https:// ]]; then
+ echo "FAIL: spec_url must use HTTPS: $SPEC_URL"
+ exit 1
+ fi
+
+ # Verify URL is accessible
+ HTTP_STATUS=$(curl -sL -o /dev/null -w '%{http_code}' "$SPEC_URL")
+ if [[ "$HTTP_STATUS" != "200" ]]; then
+ echo "FAIL: spec_url returned HTTP $HTTP_STATUS: $SPEC_URL"
+ exit 1
+ fi
+
+ echo "PASS: URL accessible ($HTTP_STATUS)"
+
+ # Download and generate
+ curl -sL -o /tmp/spec-validate.yaml "$SPEC_URL"
+ NAME=$(grep 'name:' "$file" | head -1 | sed 's/name: *//')
+
+ ./printing-press generate \
+ --spec /tmp/spec-validate.yaml \
+ --output /tmp/${NAME}-cli \
+ --validate
+
+ echo "PASS: Generated CLI compiles"
+ rm -rf /tmp/${NAME}-cli /tmp/spec-validate.yaml
+ done
+
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-go@v5
+ with:
+ go-version: '1.22'
+
+ - name: Run all tests
+ run: go test ./...
← 45045b92 feat(skill): add /printing-press submit workflow for catalog
·
back to Cli Printing Press
·
docs: add README and CLAUDE.md 16b39bf2 →