Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-cmd/tap-new: Set up GitHub Actions CI instead of Azure #7037

Merged
merged 1 commit into from Feb 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 23 additions & 16 deletions Library/Homebrew/dev-cmd/tap-new.rb
Expand Up @@ -51,24 +51,31 @@ def tap_new
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
Expand Down
3 changes: 2 additions & 1 deletion Library/Homebrew/test/dev-cmd/tap-new_spec.rb
Expand Up @@ -7,12 +7,13 @@
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