diff --git a/Formula/act.rb b/Formula/act.rb new file mode 100644 index 00000000000..c9d4e6d8983 --- /dev/null +++ b/Formula/act.rb @@ -0,0 +1,28 @@ +class Act < Formula + desc "Run your GitHub Actions locally 🚀" + homepage "https://github.com/nektos/act" + url "https://github.com/nektos/act/archive/v0.2.10.tar.gz" + sha256 "1e4d371cfa6aec7e350927e55c3ac8413dbf6e23edbb811ebe2d587dbf136928" + license "MIT" + + depends_on "go" => :build + + def install + system "make", "build", "VERSION=#{version}" + bin.install "dist/local/act" + end + + test do + system "git", "clone", "https://github.com/stefanzweifel/laravel-github-actions-demo.git" + cd "laravel-github-actions-demo" do + system "git", "checkout", "v2.0" + + pull_request_jobs = shell_output("#{bin}/act pull_request --list") + assert_match "php-cs-fixer", pull_request_jobs + + push_jobs = shell_output("#{bin}/act push --list") + assert_match "phpinsights", push_jobs + assert_match "phpunit", push_jobs + end + end +end