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

Cleanup Travis and CI configuration. #4938

Merged
merged 1 commit into from
Sep 19, 2018
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
4 changes: 2 additions & 2 deletions Library/Homebrew/extend/os/mac/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def check_xcode_up_to_date
# `brew test-bot` runs `brew doctor` in the CI for the Homebrew/brew
# repository. This only needs to support whatever CI provider
# Homebrew/brew is currently using.
return if ENV["TRAVIS"]
return if ENV["HOMEBREW_TRAVIS_CI"]

message = <<~EOS
Your Xcode (#{MacOS::Xcode.version}) is outdated.
Expand All @@ -101,7 +101,7 @@ def check_clt_up_to_date
# `brew test-bot` runs `brew doctor` in the CI for the Homebrew/brew
# repository. This only needs to support whatever CI provider
# Homebrew/brew is currently using.
return if ENV["TRAVIS"]
return if ENV["HOMEBREW_TRAVIS_CI"]

<<~EOS
A newer Command Line Tools release is available.
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ def build
Utils.safe_fork do
# Invalidate the current sudo timestamp in case a build script calls sudo.
# Travis CI's Linux sudoless workers have a weird sudo that fails here.
system "/usr/bin/sudo", "-k" unless ENV["TRAVIS_SUDO"] == "false"
system "/usr/bin/sudo", "-k" if ENV["HOMEBREW_TRAVIS_SUDO"] != "false"

if Sandbox.formula?(formula)
sandbox = Sandbox.new
Expand Down
8 changes: 6 additions & 2 deletions Library/Homebrew/test/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
if ENV["HOMEBREW_TESTS_COVERAGE"]
require "simplecov"

if ENV["CODECOV_TOKEN"] || ENV["TRAVIS"]
formatters = [SimpleCov::Formatter::HTMLFormatter]
if ENV["HOMEBREW_CODECOV_TOKEN"] || ENV["HOMEBREW_TRAVIS_CI"]
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
formatters << SimpleCov::Formatter::Codecov
ENV["CODECOV_TOKEN"] = ENV["HOMEBREW_CODECOV_TOKEN"]
end

SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
end

require "rspec/its"
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/utils/curl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def curl_args(*extra_args, show_output: false, user_agent: :default)
args << "--fail"
args << "--progress-bar" unless ARGV.verbose?
args << "--verbose" if ENV["HOMEBREW_CURL_VERBOSE"]
args << "--silent" if !$stdout.tty? || ENV["TRAVIS"]
args << "--silent" if !$stdout.tty? || ENV["HOMEBREW_TRAVIS_CI"]
end

args + extra_args
Expand Down
20 changes: 15 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@ jobs:
vmImage: xcode9-macos10.13
steps:
- bash: |
rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask*
brew update-reset
brew test-bot
displayName: brew test-bot
HOMEBREW_REPOSITORY="$(brew --repo)";
mv "$HOMEBREW_REPOSITORY/Library/Taps" "$PWD/Library";
sudo rm -rf "$HOMEBREW_REPOSITORY";
sudo ln -s "$PWD" "$HOMEBREW_REPOSITORY";
brew update-reset Library/Taps/homebrew/homebrew-core
brew test-bot --coverage
displayName: Run brew test-bot
env:
HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)

- task: PublishTestResults@2
displayName: Publish test-bot test results
inputs:
testRunner: JUnit
testResultsFiles: brew-test-bot.xml

- job: Linux
pool:
vmImage: ubuntu-16.04
steps:
- bash: |
"$PWD/bin/brew" test-bot
displayName: brew test-bot
displayName: Run brew test-bot
env:
HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)