workflows: migrate Intel runners to ephemeral

master
Bo Anderson 2022-07-18 21:36:37 +01:00 committed by GitHub
parent 3900f1512d
commit ecb81bfc5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 10 deletions

View File

@ -186,13 +186,11 @@ jobs:
strategy:
matrix:
include:
# - runner: '12-arm64-${{github.run_id}}-${{github.run_attempt}}'
# ephemeral: true
- runner: '12-arm64'
- runner: '12'
- runner: '12-${{github.run_id}}-${{github.run_attempt}}'
- runner: '11-arm64'
- runner: '11'
- runner: '10.15'
- runner: '11-${{github.run_id}}-${{github.run_attempt}}'
- runner: '10.15-${{github.run_id}}-${{github.run_attempt}}'
- runner: ${{needs.setup_tests.outputs.linux-runner}}
container:
image: ghcr.io/homebrew/ubuntu16.04:master
@ -215,8 +213,6 @@ jobs:
if: runner.os == 'macOS'
run: |
echo 'PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' >> $GITHUB_ENV
# TODO: remove the line below once set in the runner .env file
echo 'GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED=1' >> $GITHUB_ENV
- name: Set up Homebrew
id: set-up-homebrew
@ -304,7 +300,7 @@ jobs:
run: rm -rvf bottles/failed
- name: Upload bottles
if: always() && steps.bottles.outputs.count > 0 && !matrix.ephemeral
if: always() && steps.bottles.outputs.count > 0
uses: actions/upload-artifact@main
with:
name: bottles

View File

@ -48,7 +48,9 @@ module Homebrew
if macos_version.outdated_release? || macos_version.prerelease?
nil
else
macos_runners = [{ runner: macos_version.to_s }]
macos_runners = [{
runner: "#{macos_version}-#{ENV.fetch("GITHUB_RUN_ID")}-#{ENV.fetch("GITHUB_RUN_ATTEMPT")}",
}]
macos_runners << { runner: "#{macos_version}-arm64" } if macos_version >= :big_sur
macos_runners
end
@ -61,7 +63,11 @@ module Homebrew
nil # Don't rebottle for older macOS versions (no CI to build them).
else
runner = macos_version.to_s
runner += "-#{tag.arch}" unless tag.arch == :x86_64
runner += if tag.arch == :x86_64
"-#{ENV.fetch("GITHUB_RUN_ID")}-#{ENV.fetch("GITHUB_RUN_ATTEMPT")}"
else
"-#{tag.arch}"
end
{ runner: runner }
end
rescue MacOSVersionError