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?
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?
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