How to run GitHub Actions workflows locally?

前端 未结 3 1532
野的像风
野的像风 2021-02-05 01:39

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

相关标签:
3条回答
  • 2021-02-05 01:49

    You can use nektos/act which supports yaml syntax since 0.2.0 (prerelease).

    Check out their latest release.

    0 讨论(0)
  • 2021-02-05 01:50

    your best bet is https://github.com/nektos/act however it doesn't support yaml syntax yet, though there is a lot of interest aka: https://github.com/nektos/act/issues/80 https://github.com/nektos/act/issues/76 and https://github.com/nektos/act/issues/74

    Gitlab has gitlab-runner exec docker job-name but that's Gitlab :)

    0 讨论(0)
  • 2021-02-05 02:04

    There are tools like the already-mentioned act, but they are not perfect. You are not alone with this issue. Similar problems are:

    • how to test Jenkins builds locally
    • how to test GitLab CI builds locally
    • how to test Circle CI builds locally
    • how to test XXXX builds locally

    And my solution for these problems is:

    • avoid functionalities provided by your CI tools (GitHub Actions, Gitlab CI, etc)
    • write as much as possible in 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
    0 讨论(0)
提交回复
热议问题