From ff728da97ba7e667f64e41b387e2e494936d23dc Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Thu, 27 Apr 2023 16:45:51 +0800 Subject: [PATCH] github_runner_matrix: remove `HOMEBREW_LINUX_CLEANUP` This will allow us to remove handling of this in our workflow files in Homebrew/core. --- Library/Homebrew/github_runner_matrix.rb | 7 ++++--- .../Homebrew/test/dev-cmd/determine-test-runners_spec.rb | 1 - Library/Homebrew/test/github_runner_matrix_spec.rb | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/github_runner_matrix.rb b/Library/Homebrew/github_runner_matrix.rb index cefa4c25a0..fbfe5a3191 100644 --- a/Library/Homebrew/github_runner_matrix.rb +++ b/Library/Homebrew/github_runner_matrix.rb @@ -62,10 +62,11 @@ class GitHubRunnerMatrix private + SELF_HOSTED_LINUX_RUNNER = "linux-self-hosted-1" + sig { returns(LinuxRunnerSpec) } def linux_runner_spec - linux_runner = ENV.fetch("HOMEBREW_LINUX_RUNNER") - linux_cleanup = ENV.fetch("HOMEBREW_LINUX_CLEANUP") + linux_runner = ENV.fetch("HOMEBREW_LINUX_RUNNER") LinuxRunnerSpec.new( name: "Linux", @@ -76,7 +77,7 @@ class GitHubRunnerMatrix }, workdir: "/github/home", timeout: 4320, - cleanup: linux_cleanup == "true", + cleanup: linux_runner == SELF_HOSTED_LINUX_RUNNER, ) end diff --git a/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb b/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb index c593d3cd0a..ce9fe20ca2 100644 --- a/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb +++ b/Library/Homebrew/test/dev-cmd/determine-test-runners_spec.rb @@ -15,7 +15,6 @@ describe "brew determine-test-runners" do let(:runner_env) do { "HOMEBREW_LINUX_RUNNER" => linux_runner, - "HOMEBREW_LINUX_CLEANUP" => "false", "HOMEBREW_MACOS_TIMEOUT" => "90", "GITHUB_RUN_ID" => ephemeral_suffix.split("-").second, "GITHUB_RUN_ATTEMPT" => ephemeral_suffix.split("-").third, diff --git a/Library/Homebrew/test/github_runner_matrix_spec.rb b/Library/Homebrew/test/github_runner_matrix_spec.rb index 48ba95d5da..12e9ba8e37 100644 --- a/Library/Homebrew/test/github_runner_matrix_spec.rb +++ b/Library/Homebrew/test/github_runner_matrix_spec.rb @@ -6,7 +6,6 @@ require "test/support/fixtures/testball" describe GitHubRunnerMatrix do before do allow(ENV).to receive(:fetch).with("HOMEBREW_LINUX_RUNNER").and_return("ubuntu-latest") - allow(ENV).to receive(:fetch).with("HOMEBREW_LINUX_CLEANUP").and_return("false") allow(ENV).to receive(:fetch).with("HOMEBREW_MACOS_TIMEOUT").and_return("90") allow(ENV).to receive(:fetch).with("HOMEBREW_MACOS_BUILD_ON_GITHUB_RUNNER", "false").and_return("false") allow(ENV).to receive(:fetch).with("GITHUB_RUN_ID").and_return("12345")