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

View File

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