From 6b27dcb11ce2a353c73ea7fd771b960899702736 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 6 Nov 2020 15:11:33 +0000 Subject: [PATCH] workflows/tests: use Big Sur. Migrate GitHub Actions to Big Sur. --- .github/workflows/tests.yml | 13 ++++++++++--- Library/Homebrew/extend/os/mac/diagnostic.rb | 3 +++ Library/Homebrew/test/os/mac/diagnostic_spec.rb | 1 + Library/Homebrew/test/spec_helper.rb | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f17db8b4ee..0a975b1834 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,18 +6,21 @@ on: env: HOMEBREW_DEVELOPER: 1 HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_GITHUB_ACTIONS_BIG_SUR_TESTING: 1 # TODO: remove when Big Sur is released. jobs: tests: if: github.repository == 'Homebrew/brew' runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest, macOS-latest, macOS-11.0] include: - os: ubuntu-latest core-tap: 'linuxbrew-core' - os: macOS-latest core-tap: 'homebrew-core' + - os: macOS-11.0 + core-tap: 'homebrew-core' steps: - name: Set up Homebrew id: set-up-homebrew @@ -30,6 +33,10 @@ jobs: - run: brew test-bot --only-cleanup-before + - name: Set up Xcode + if: matrix.os == 'macOS-11.0' + run: sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer + - run: brew config # Can't cache this because we need to check that it doesn't fail the @@ -60,7 +67,7 @@ jobs: run: brew man --fail-if-changed - name: Install brew tests dependencies - if: matrix.os == 'macOS-latest' + if: matrix.os != 'ubuntu-latest' run: | brew install subversion Library/Homebrew/shims/scm/svn --homebrew=print-path @@ -108,7 +115,7 @@ jobs: run: brew style --display-cop-names homebrew/bundle homebrew/services homebrew/test-bot - name: Run brew cask style on all taps - if: matrix.os == 'macOS-latest' + if: matrix.os != 'ubuntu-latest' run: | brew tap homebrew/cask brew tap homebrew/cask-drivers diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index 7b05358af4..46974b7f61 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -93,6 +93,9 @@ module Homebrew def check_for_unsupported_macos return if Homebrew::EnvConfig.developer? + # TODO: remove when Big Sur is released. + return if MacOS.version == :big_sur && ENV["HOMEBREW_GITHUB_ACTIONS_BIG_SUR_TESTING"] + who = +"We" if OS::Mac.prerelease? what = "pre-release version" diff --git a/Library/Homebrew/test/os/mac/diagnostic_spec.rb b/Library/Homebrew/test/os/mac/diagnostic_spec.rb index de6ed40659..3528775e54 100644 --- a/Library/Homebrew/test/os/mac/diagnostic_spec.rb +++ b/Library/Homebrew/test/os/mac/diagnostic_spec.rb @@ -6,6 +6,7 @@ require "diagnostic" describe Homebrew::Diagnostic::Checks do specify "#check_for_unsupported_macos" do ENV.delete("HOMEBREW_DEVELOPER") + allow(OS::Mac).to receive(:version).and_return(OS::Mac::Version.new("10.14")) allow(OS::Mac).to receive(:prerelease?).and_return(true) expect(subject.check_for_unsupported_macos) diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 78d0dee36d..91697e5218 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -109,7 +109,7 @@ RSpec.configure do |config| config.before(:each, :needs_java) do java_installed = if OS.mac? - Utils.popen_read("/usr/libexec/java_home", "--failfast") + Utils.popen_read("/usr/libexec/java_home", "--failfast", "--version", "1.0+") $CHILD_STATUS.success? else which("java")