diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index e4e9e268f2..5c4cf97e19 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -51,24 +51,31 @@ module Homebrew MARKDOWN write_path(tap, "README.md", readme) - azure = <<~YAML + actions = <<~YAML + name: brew test-bot + on: + push: + branches: master + pull_request: [] jobs: - - job: macOS - pool: - vmImage: macOS-10.14 - steps: - - bash: | - set -e - sudo xcode-select --switch /Applications/Xcode_10.2.1.app/Contents/Developer - brew update - HOMEBREW_TAP_DIR="/usr/local/Homebrew/Library/Taps/#{tap.full_name}" - mkdir -p "$HOMEBREW_TAP_DIR" - rm -rf "$HOMEBREW_TAP_DIR" - ln -s "$PWD" "$HOMEBREW_TAP_DIR" - brew test-bot - displayName: Run brew test-bot + test-bot: + runs-on: macos-latest + steps: + - name: Set up Git repository + uses: actions/checkout@v2 + - name: Run brew test-bot + run: | + set -e + brew update + HOMEBREW_TAP_DIR="/usr/local/Homebrew/Library/Taps/#{tap.full_name}" + mkdir -p "$HOMEBREW_TAP_DIR" + rm -rf "$HOMEBREW_TAP_DIR" + ln -s "$PWD" "$HOMEBREW_TAP_DIR" + brew test-bot YAML - write_path(tap, "azure-pipelines.yml", azure) + + (tap.path/".github/workflows").mkpath + write_path(tap, ".github/workflows/main.yml", actions) ohai "Created #{tap}" puts tap.path.to_s end diff --git a/Library/Homebrew/test/dev-cmd/tap-new_spec.rb b/Library/Homebrew/test/dev-cmd/tap-new_spec.rb index 316637c048..3a9cb57197 100644 --- a/Library/Homebrew/test/dev-cmd/tap-new_spec.rb +++ b/Library/Homebrew/test/dev-cmd/tap-new_spec.rb @@ -7,12 +7,13 @@ describe "Homebrew.tap_new_args" do end describe "brew tap-new", :integration_test do - it "initializes a new Tap with a ReadMe file" do + it "initializes a new Tap with a ReadMe file and GitHub Actions CI" do expect { brew "tap-new", "homebrew/foo", "--verbose" } .to be_a_success .and output(%r{homebrew/foo}).to_stdout .and not_to_output.to_stderr expect(HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-foo/README.md").to exist + expect(HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-foo/.github/workflows/main.yml").to exist end end