mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
dev-cmd/tap-new: Set up GitHub Actions CI instead of Azure
- We recently removed Azure as a supported CI provider (Homebrew/homebrew-test-bot PR 325), so `brew test-bot` won't run on Azure any more. - Homebrew CI is moving towards GitHub Actions as the standard.
This commit is contained in:
parent
cb4316df97
commit
b3abf3d7c9
@ -51,24 +51,31 @@ module Homebrew
|
|||||||
MARKDOWN
|
MARKDOWN
|
||||||
write_path(tap, "README.md", readme)
|
write_path(tap, "README.md", readme)
|
||||||
|
|
||||||
azure = <<~YAML
|
actions = <<~YAML
|
||||||
|
name: brew test-bot
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
pull_request: []
|
||||||
jobs:
|
jobs:
|
||||||
- job: macOS
|
test-bot:
|
||||||
pool:
|
runs-on: macos-latest
|
||||||
vmImage: macOS-10.14
|
steps:
|
||||||
steps:
|
- name: Set up Git repository
|
||||||
- bash: |
|
uses: actions/checkout@v2
|
||||||
set -e
|
- name: Run brew test-bot
|
||||||
sudo xcode-select --switch /Applications/Xcode_10.2.1.app/Contents/Developer
|
run: |
|
||||||
brew update
|
set -e
|
||||||
HOMEBREW_TAP_DIR="/usr/local/Homebrew/Library/Taps/#{tap.full_name}"
|
brew update
|
||||||
mkdir -p "$HOMEBREW_TAP_DIR"
|
HOMEBREW_TAP_DIR="/usr/local/Homebrew/Library/Taps/#{tap.full_name}"
|
||||||
rm -rf "$HOMEBREW_TAP_DIR"
|
mkdir -p "$HOMEBREW_TAP_DIR"
|
||||||
ln -s "$PWD" "$HOMEBREW_TAP_DIR"
|
rm -rf "$HOMEBREW_TAP_DIR"
|
||||||
brew test-bot
|
ln -s "$PWD" "$HOMEBREW_TAP_DIR"
|
||||||
displayName: Run brew test-bot
|
brew test-bot
|
||||||
YAML
|
YAML
|
||||||
write_path(tap, "azure-pipelines.yml", azure)
|
|
||||||
|
(tap.path/".github/workflows").mkpath
|
||||||
|
write_path(tap, ".github/workflows/main.yml", actions)
|
||||||
ohai "Created #{tap}"
|
ohai "Created #{tap}"
|
||||||
puts tap.path.to_s
|
puts tap.path.to_s
|
||||||
end
|
end
|
||||||
|
@ -7,12 +7,13 @@ describe "Homebrew.tap_new_args" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "brew tap-new", :integration_test do
|
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" }
|
expect { brew "tap-new", "homebrew/foo", "--verbose" }
|
||||||
.to be_a_success
|
.to be_a_success
|
||||||
.and output(%r{homebrew/foo}).to_stdout
|
.and output(%r{homebrew/foo}).to_stdout
|
||||||
.and not_to_output.to_stderr
|
.and not_to_output.to_stderr
|
||||||
|
|
||||||
expect(HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-foo/README.md").to exist
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user