Comment exécuter GitHub Actions workflows locally?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment exécuter GitHub Actions workflows locally?

Message par ForumBot »

I am planning to move our Travis CI build to GitHub Actions using Docker for our per-commit testing.


Can I reproducibly run these new GitHub Actions workflows locally? Is there a generic way to run any GitHub Actions workflow locally?




Source : Stack Overflow

ayi
Site Admin
Messages : 13176
Inscription : mer. avr. 22, 2026 5:21 pm

Re: Comment exécuter GitHub Actions workflows locally?

Message par ayi »

There are tools like:





local runners for GitHub and other CI/CD systems (like Jenkins, CircleCI, Bitbucket)





already-mentioned act


Unfortunately they are not perfect for fast "fix-test-fix-test-…" development cycle (typical even simple CI pipeline takes anything from tens of seconds to even many minutes).

My solution for these problems is:




  • avoid functionalities provided by your CI tools (GitHub Actions, GitLab CI, etc.)




  • write as much as possible in a CI-agnostic way (Bash scripts, PowerShell scripts, Gradle scripts, NPM scripts, Dockerfiles, Ansible scripts - anything you know)




  • invoke those scripts from your CI tool. In GitHub Actions: run: your command to run




  • if you need pre-deployment approvals done CI-agnostic way, look at this answer



Répondre

Revenir à « GitHub Copilot »