workflows: invoke self-hosted logic on Linux (#91274)

master
Bo Anderson 2021-12-14 19:09:41 +00:00 committed by GitHub
parent d2e141b142
commit e0174499bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 12 deletions

View File

@ -70,14 +70,11 @@ jobs:
echo wheezy=${{github.event.inputs.wheezy}}
- name: Set environment variables
if: runner.os == 'macOS'
run: |
if [ "$RUNNER_OS" = 'macOS' ]; then
echo 'PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' >> $GITHUB_ENV
echo 'GITHUB_ACTIONS_HOMEBREW_MACOS_SELF_HOSTED=1' >> $GITHUB_ENV
else
# No PATH needed on Linux as set by Docker
echo 'HOMEBREW_FORCE_HOMEBREW_ON_LINUX=1' >> $GITHUB_ENV
fi
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: Run Docker container
if: runner.os == 'Linux'

View File

@ -72,7 +72,8 @@ jobs:
if: runner.os == 'macOS'
run: |
echo 'PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' >> $GITHUB_ENV
echo 'GITHUB_ACTIONS_HOMEBREW_MACOS_SELF_HOSTED=1' >> $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

View File

@ -141,7 +141,7 @@ jobs:
console.log('No CI-linux-wheezy label found. Using default Homebrew (Ubuntu 16.04) container.')
container.image = 'ghcr.io/homebrew/ubuntu16.04:master'
}
container.options = '--user=linuxbrew'
container.options = '--user=linuxbrew -e GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED'
core.setOutput('container', JSON.stringify(container))
const test_bot_formulae_args = ["--only-formulae", "--junit", "--only-json-tab", "--skip-dependents"]
@ -207,7 +207,8 @@ jobs:
if: runner.os == 'macOS'
run: |
echo 'PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' >> $GITHUB_ENV
echo 'GITHUB_ACTIONS_HOMEBREW_MACOS_SELF_HOSTED=1' >> $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
@ -220,7 +221,6 @@ jobs:
- name: Run brew test-bot ${{ needs.setup_tests.outputs.test-bot-formulae-args }}
id: brew-test-bot-formulae
run: |
rm -rf bottles
mkdir bottles
cd bottles
brew test-bot ${{ needs.setup_tests.outputs.test-bot-formulae-args }}

View File

@ -35,7 +35,7 @@ module Homebrew
runner: linux_runner,
container: {
image: "ghcr.io/homebrew/ubuntu16.04:master",
options: "--user=linuxbrew",
options: "--user=linuxbrew -e GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED",
},
workdir: "/github/home",
}