Skip to content

ci: local CI testing with actionlint and act - #47

Merged
tkolleh merged 10 commits into
mainfrom
ci/local-testing-and-actionlint
Apr 10, 2026
Merged

ci: local CI testing with actionlint and act#47
tkolleh merged 10 commits into
mainfrom
ci/local-testing-and-actionlint

Conversation

@tkolleh

@tkolleh tkolleh commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add actionlint as a lefthook pre-commit hook, scoped to staged workflow YAML files
  • Fix shellcheck findings (SC2012/SC2035) in publish.yml by replacing ls with find
  • Add act configuration (.actrc) for running GitHub Actions workflows locally via Docker
  • Add !env.ACT step-level guards to skip API-dependent steps (PR comments, uploads, release-please) when running under act
  • Add just act-test, act-lint, act-publish recipes for convenient local workflow execution

Test plan

  • actionlint passes with zero findings
  • just --list shows all three act recipes in the ci group
  • lefthook run pre-commit recognizes the actionlint hook
  • just act-test runs the test job locally (requires act + Docker)
  • just act-lint runs the lint job locally
  • just act-publish validates rockspec generation locally
  • GitHub Actions CI passes on this branch (workflows unchanged in behavior)

tkolleh and others added 10 commits April 9, 2026 16:29
Replace ls with find in publish.yml to resolve SC2012/SC2035
shellcheck warnings, enabling a clean actionlint pass. Add
actionlint as a lefthook pre-commit command scoped to staged
workflow files.
Create .actrc with ubuntu-24.04 runner mapping and amd64
container architecture for macOS arm64 compatibility.
Add .secrets to .gitignore to prevent accidental token commits.
Guard steps that require GitHub API access or external secrets
so they are cleanly skipped when running workflows locally via
act. Affects: PR comment (tests.yml), LuaRocks upload
(publish.yml), release-please action and artifact upload
(release-please.yml).
Add act-test, act-lint, and act-publish recipes to the ci group.
Each recipe targets a specific workflow and injects GITHUB_TOKEN
from the local gh CLI session to avoid API rate limits.
Document the pre-commit hook table including the new actionlint
hook, and add a "Local CI Verification (macOS)" section covering
act prerequisites, Docker image setup, DOCKER_HOST configuration
for Rancher Desktop, and the available just recipes.
The correct socket path is ~/.rd/docker.sock, not
~/.rd/run/docker.sock. The run/ subdirectory was never
an official Rancher Desktop path.
Add --container-daemon-socket - to .actrc to prevent act from
bind-mounting the Docker socket into containers. Our workflows
don't need Docker-in-Docker, and the mount fails on Rancher
Desktop / Colima where the socket is not at /var/run/docker.sock.
Corporate security proxies (Netskope, Zscaler) re-sign TLS
certificates with their own CA, which containers don't trust.
Set NODE_TLS_REJECT_UNAUTHORIZED=0 in .actrc so Node.js actions
can reach GitHub APIs from inside act containers.
Accept main's per-platform upload steps (linux-x86_64 with
rockspec, linux-aarch64, windows, macOS) from the CI matrix
expansion and add !env.ACT guards to all four upload steps.
@tkolleh
tkolleh marked this pull request as ready for review April 10, 2026 21:44
@tkolleh
tkolleh merged commit 552f4a3 into main Apr 10, 2026
2 checks passed
@tkolleh
tkolleh deleted the ci/local-testing-and-actionlint branch April 10, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant