Skip to content

Commit 4090221

Browse files
JacobCoffeeclaude
andcommitted
feat: add act support for local GitHub Actions testing
- Add Makefile targets for testing workflows locally with act - Fix cd.yml workflow issues: - Remove working-directory from action step (only valid for run steps) - Simplify PR body to single line to avoid YAML parsing issues - Update OUTPUT path to include worktree directory 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent efc5b7d commit 4090221

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

.github/workflows/cd.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,12 @@ jobs:
4040
run: git worktree add worktree-changelog origin/main
4141

4242
- name: Generate full changelog in worktree
43-
working-directory: worktree-changelog
4443
uses: orhun/git-cliff-action@v4
4544
with:
4645
config: pyproject.toml
4746
args: -vv
4847
env:
49-
OUTPUT: docs/changelog.rst
48+
OUTPUT: worktree-changelog/docs/changelog.rst
5049
GITHUB_REPO: ${{ github.repository }}
5150

5251
- name: Create PR with changelog updates
@@ -70,9 +69,7 @@ jobs:
7069
--base main \
7170
--head "$BRANCH_NAME" \
7271
--title "docs: update changelog" \
73-
--body "Automated changelog update generated by git-cliff.
74-
75-
This PR updates the changelog with the latest commits." \
72+
--body "Automated changelog update generated by git-cliff. This PR updates the changelog with the latest commits." \
7673
--label "documentation" \
7774
--label "automated"
7875
fi

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ UV ?= uv $(UV_OPTS)
1919
.PHONY: docker-up docker-down docker-logs docker-shell-api docker-shell-bot docker-ps
2020
.PHONY: docker-restart docker-rebuild infra-up infra-down
2121
.PHONY: worktree worktree-prune
22+
.PHONY: act-list act-ci act-cd act-docs-preview
2223

2324
help: ## Display this help text for Makefile
2425
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@@ -293,6 +294,29 @@ worktree-prune: ## Clean up stale git worktrees
293294
@git worktree prune -v
294295
@echo "=> Stale worktrees pruned"
295296

297+
# =============================================================================
298+
# GitHub Actions Local Testing (act)
299+
# =============================================================================
300+
301+
##@ Local GitHub Actions
302+
303+
act-list: ## List all available GitHub Actions workflows
304+
@echo "=> Available GitHub Actions workflows:"
305+
@act -l
306+
307+
act-ci: ## Test CI workflow locally using act
308+
@echo "=> Running CI workflow locally with act"
309+
@act -j lint -j type-check -j test -j build --container-architecture linux/amd64
310+
311+
act-cd: ## Test CD workflow locally using act (dry-run, no push)
312+
@echo "=> Running CD workflow locally with act (dry-run)"
313+
@echo "NOTE: This will not actually push/release, just test the workflow"
314+
@act -j generate-changelog --container-architecture linux/amd64
315+
316+
act-docs-preview: ## Test docs-preview workflow locally using act
317+
@echo "=> Running docs-preview workflow locally with act"
318+
@act pull_request -j build-and-deploy-docs --container-architecture linux/amd64
319+
296320
# =============================================================================
297321
# Main
298322
# =============================================================================

0 commit comments

Comments
 (0)