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}} echo wheezy=${{github.event.inputs.wheezy}}
- name: Set environment variables - name: Set environment variables
if: runner.os == 'macOS'
run: | run: |
if [ "$RUNNER_OS" = 'macOS' ]; then
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
echo 'GITHUB_ACTIONS_HOMEBREW_MACOS_SELF_HOSTED=1' >> $GITHUB_ENV # TODO: remove the line below once set in the runner .env file
else echo 'GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED=1' >> $GITHUB_ENV
# No PATH needed on Linux as set by Docker
echo 'HOMEBREW_FORCE_HOMEBREW_ON_LINUX=1' >> $GITHUB_ENV
fi
- name: Run Docker container - name: Run Docker container
if: runner.os == 'Linux' if: runner.os == 'Linux'

View File

@ -72,7 +72,8 @@ 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
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 - name: Set up Homebrew
id: 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.') console.log('No CI-linux-wheezy label found. Using default Homebrew (Ubuntu 16.04) container.')
container.image = 'ghcr.io/homebrew/ubuntu16.04:master' 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)) core.setOutput('container', JSON.stringify(container))
const test_bot_formulae_args = ["--only-formulae", "--junit", "--only-json-tab", "--skip-dependents"] const test_bot_formulae_args = ["--only-formulae", "--junit", "--only-json-tab", "--skip-dependents"]
@ -207,7 +207,8 @@ 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
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 - name: Set up Homebrew
id: 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 }} - name: Run brew test-bot ${{ needs.setup_tests.outputs.test-bot-formulae-args }}
id: brew-test-bot-formulae id: brew-test-bot-formulae
run: | run: |
rm -rf bottles
mkdir bottles mkdir bottles
cd bottles cd bottles
brew test-bot ${{ needs.setup_tests.outputs.test-bot-formulae-args }} brew test-bot ${{ needs.setup_tests.outputs.test-bot-formulae-args }}

View File

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