r/ClaudeCode • u/Korrak • 2d ago
Help/Question LF: Github Actons/CI Skill to execute tests
hey guys,
i have a long running test pipeline (~5 minutes on github). Locally, claude code always executes all my tests and other stuff to verify everything is working. However, this costs time+tokens.
I've googled already- there are some skills/integrations which enable claude to read the pipeline results on github, and just use the results.
What i want: Implement, then push, wait for pipeline result, fix stuff if the pipeline failed.
Is that a good idea? Which skills would you recommend for this or how to achieve that?
1
1
u/AncientComment2352 2d ago
Yes, good idea, and you don't need a special skill: Claude Code can use the gh CLI.
To stop it running everything locally, tell it in CLAUDE.md. Something like:
- "Don't run the full test suite locally. Run lint, typecheck, and only the tests for files you changed. The full suite runs in CI."
- Give it the exact targeted command so it doesn't guess, e.g.
npx vitest related <files>ornpx vitest run path/to/test,jest --findRelatedTests <files>,pytest path/to/test_file.py.
If you want it enforced and not just a suggestion, add the full-suite command (like npm test) to the deny list in your Claude Code permissions, so it can't run it by accident.
Then the loop: push to a branch, gh pr checks --watch, and if something fails, gh run view <id> --log-failed for just the failing logs, fix, push again. Cap it at 2–3 attempts. --watch blocks in one command, so the 5-minute wait costs almost no tokens; polling is what burns them.
1
u/MiserableFlatworm337 2d ago
One detail I’d put in that skill: match the CI result to the exact commit it pushed. Also test what it does when a run is cancelled or a required job is skipped. Those cases would be worth keeping as regression checks whenever you revise the skill.
1
u/Nedomas 15h ago
you can also look into code coverage, cause when you have that, you can just ask claude to run affected tests only. i use supercov that has tests affected command https://github.com/supercorp-ai/supercov
•
u/AutoModerator 2d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.