C.W.K.
Stream
Lesson 07 of 13 · published

Act — 로컬 workflow 테스트

~9 min · act, local, debugging

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

Push-and-pray 그만

Act (nektos/act) 가 GitHub Actions workflow 를 Docker 에서 로컬 실행. 유용: CI 분 안 태우고 Actions tab 을 'fix typo' commit 으로 오염 안 하고 workflow YAML 반복, matrix 확장 디버깅, expression 검증.

설치 + 실행

brew install act       # 또는: gh extension install nektos/gh-act
act -W .github/workflows/ci.yml
act -W .github/workflows/ci.yml -j test # 특정 job
act pull_request # 특정 event

제한

  • Act 는 Docker 에서 돔; macOS job 은 Linux Act 호출에서 못 돔.
  • 일부 GitHub-hosted 기능 (Apple 특정 action, secret vault, OIDC) 은 로컬에서 동작 안 함.
  • Image 가 GitHub 의 것과 다름; 작은 깜짝 기대.

동반 도구

  • actionlint — workflow YAML 정적 lint. Event 이름, expression 의 typo 등 실행 없이 잡음.
  • gh act — act 감싸는 GitHub CLI 확장.

Code

Workflow + actionlint + act 루프·bash
# Add a Makefile target that runs both checks
cat <<'EOF' > Makefile
ci-lint:
	actionlint .github/workflows/*.yml

ci-run:
	act -W .github/workflows/ci.yml -j test

ci-all: ci-lint ci-run
EOF

# Iterate without pushing
make ci-all

External links

Exercise

Act + actionlint 설치. Repo 의 workflow 에서 실행. 같은 주에 모든 actionlint 경고 수정. 다음에 'fix workflow' commit push 할 뻔하면 act 사용.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.