Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GITHUB_PATH to modify paths between CI steps. #17882

Merged
merged 1 commit into from
Dec 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/test-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,14 @@ jobs:
go-version: 1.17.1
- if: runner.os == 'Linux'
name: Download Apache `thrift` binary (Linux)
run: 'mkdir -p "$HOME/.thrift"
run: 'mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift
-o "$HOME/.thrift/thrift"
-o "${HOME}/.thrift/thrift"
chmod +x "$HOME/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "PATH=${PATH}:${HOME}/.thrift" >> $GITHUB_ENV
echo "${HOME}/.thrift" >> $GITHUB_PATH
'
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -376,14 +376,14 @@ jobs:
go-version: 1.17.1
- if: runner.os == 'Linux'
name: Download Apache `thrift` binary (Linux)
run: 'mkdir -p "$HOME/.thrift"
run: 'mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift
-o "$HOME/.thrift/thrift"
-o "${HOME}/.thrift/thrift"
chmod +x "$HOME/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "PATH=${PATH}:${HOME}/.thrift" >> $GITHUB_ENV
echo "${HOME}/.thrift" >> $GITHUB_PATH
'
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -447,14 +447,14 @@ jobs:
go-version: 1.17.1
- if: runner.os == 'Linux'
name: Download Apache `thrift` binary (Linux)
run: 'mkdir -p "$HOME/.thrift"
run: 'mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift
-o "$HOME/.thrift/thrift"
-o "${HOME}/.thrift/thrift"
chmod +x "$HOME/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "PATH=${PATH}:${HOME}/.thrift" >> $GITHUB_ENV
echo "${HOME}/.thrift" >> $GITHUB_PATH
'
- name: Set up Python ${{ matrix.python-version }}
Expand Down
35 changes: 20 additions & 15 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,17 @@ jobs:
run: 'curl --proto ''=https'' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s --
-v -y --default-toolchain none
echo "PATH=${PATH}:${HOME}/.cargo/bin" >> $GITHUB_ENV
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
'
- name: Expose Pythons
run: echo "PATH=${PATH}:/opt/python/cp37-cp37m/bin:/opt/python/cp38-cp38/bin:/opt/python/cp39-cp39/bin"
>> $GITHUB_ENV
run: 'echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH
echo "/opt/python/cp38-cp38/bin" >> $GITHUB_PATH
echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH
'
- if: github.event_name != 'pull_request'
name: Setup toolchain auth
run: 'echo TOOLCHAIN_AUTH_TOKEN="${{ secrets.TOOLCHAIN_AUTH_TOKEN }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -638,14 +643,14 @@ jobs:
go-version: 1.17.1
- if: runner.os == 'Linux'
name: Download Apache `thrift` binary (Linux)
run: 'mkdir -p "$HOME/.thrift"
run: 'mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift
-o "$HOME/.thrift/thrift"
-o "${HOME}/.thrift/thrift"
chmod +x "$HOME/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "PATH=${PATH}:${HOME}/.thrift" >> $GITHUB_ENV
echo "${HOME}/.thrift" >> $GITHUB_PATH
'
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -711,14 +716,14 @@ jobs:
go-version: 1.17.1
- if: runner.os == 'Linux'
name: Download Apache `thrift` binary (Linux)
run: 'mkdir -p "$HOME/.thrift"
run: 'mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift
-o "$HOME/.thrift/thrift"
-o "${HOME}/.thrift/thrift"
chmod +x "$HOME/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "PATH=${PATH}:${HOME}/.thrift" >> $GITHUB_ENV
echo "${HOME}/.thrift" >> $GITHUB_PATH
'
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -784,14 +789,14 @@ jobs:
go-version: 1.17.1
- if: runner.os == 'Linux'
name: Download Apache `thrift` binary (Linux)
run: 'mkdir -p "$HOME/.thrift"
run: 'mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift
-o "$HOME/.thrift/thrift"
-o "${HOME}/.thrift/thrift"
chmod +x "$HOME/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "PATH=${PATH}:${HOME}/.thrift" >> $GITHUB_ENV
echo "${HOME}/.thrift" >> $GITHUB_PATH
'
- name: Set up Python ${{ matrix.python-version }}
Expand Down
21 changes: 11 additions & 10 deletions build-support/bin/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def install_rustup() -> Step:
"run": dedent(
"""\
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -v -y --default-toolchain none
echo "PATH=${PATH}:${HOME}/.cargo/bin" >> $GITHUB_ENV
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
"""
),
}
Expand Down Expand Up @@ -293,10 +293,10 @@ def download_apache_thrift() -> Step:
"if": "runner.os == 'Linux'",
"run": dedent(
"""\
mkdir -p "$HOME/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift -o "$HOME/.thrift/thrift"
chmod +x "$HOME/.thrift/thrift"
echo "PATH=${PATH}:${HOME}/.thrift" >> $GITHUB_ENV
mkdir -p "${HOME}/.thrift"
curl --fail -L https://binaries.pantsbuild.org/bin/thrift/linux/x86_64/0.15.0/thrift -o "${HOME}/.thrift/thrift"
chmod +x "${HOME}/.thrift/thrift"
echo "${HOME}/.thrift" >> $GITHUB_PATH
"""
),
}
Expand Down Expand Up @@ -618,11 +618,12 @@ def build_wheels_job(platform: Platform, python_versions: list[str]) -> Jobs:
install_rustup(),
{
"name": "Expose Pythons",
"run": (
'echo "PATH=${PATH}:'
"/opt/python/cp37-cp37m/bin:"
"/opt/python/cp38-cp38/bin:"
'/opt/python/cp39-cp39/bin" >> $GITHUB_ENV'
"run": dedent(
"""\
echo "/opt/python/cp37-cp37m/bin" >> $GITHUB_PATH
echo "/opt/python/cp38-cp38/bin" >> $GITHUB_PATH
echo "/opt/python/cp39-cp39/bin" >> $GITHUB_PATH
"""
),
},
]
Expand Down