Skip to content

Commit 1266f79

Browse files
Refactor Github Action per b/485167538
1 parent c7e213b commit 1266f79

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

.github/workflows/external-account-integration.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ jobs:
5656
working-directory: "${{runner.temp}}"
5757
run: |
5858
mkdir -p vcpkg
59-
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${{ steps.vcpkg-version.outputs.version }}.tar.gz" |
59+
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${STEPS_VCPKG_VERSION_OUTPUTS_VERSION}.tar.gz" |
6060
tar -C vcpkg --strip-components=1 -zxf -
6161
vcpkg/bootstrap-vcpkg.sh -disableMetrics
62+
env:
63+
STEPS_VCPKG_VERSION_OUTPUTS_VERSION: ${{ steps.vcpkg-version.outputs.version }}
6264
# First compile the code using the identity with access to the build cache
6365
- run: |
6466
env VCPKG_ROOT="${{ runner.temp }}/vcpkg" ci/gha/builds/external-account.sh

.github/workflows/test-runner.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ jobs:
3939
run: |
4040
echo "event=${{ github.event_name }}"
4141
echo "assoc=${{ github.event.pull_request.author_association }}"
42-
echo "org=${{ github.organization }}" || true
43-
echo "user=${{ github.event.pull_request.user }}" || true
44-
echo "user_orgs=${{ github.event.pull_request.user.organizations_url }}" || true
42+
echo "org=${GITHUB_ORGANIZATION}" || true
43+
echo "user=${GITHUB_EVENT_PULL_REQUEST_USER}" || true
44+
echo "user_orgs=${GITHUB_EVENT_PULL_REQUEST_USER_ORGANIZATIONS_URL}" || true
45+
env:
46+
GITHUB_ORGANIZATION: ${{ github.organization }}
47+
GITHUB_EVENT_PULL_REQUEST_USER: ${{ github.event.pull_request.user }}
48+
GITHUB_EVENT_PULL_REQUEST_USER_ORGANIZATIONS_URL: ${{ github.event.pull_request.user.organizations_url }}
4549

4650
pre-flight:
4751
# Save the `ref` of the pull request, so downstream jobs know what to checkout.

.github/workflows/windows-bazel.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ jobs:
9797
# Using a short name like this avoids the problem in most cases.
9898
mkdir -p 'c:\b' || true
9999
export BAZEL_ROOT='c:\b'
100-
export BAZEL_REMOTE_CACHE_RW_MODE=${{ inputs.bazel-cache-mode }}
100+
export BAZEL_REMOTE_CACHE_RW_MODE=${INPUTS_BAZEL_CACHE_MODE}
101101
export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }}
102102
ci/gha/builds/windows-bazel.sh ${{ matrix.compilation_mode }} ${{ join(matrix.targets, ' ') }}
103+
env:
104+
INPUTS_BAZEL_CACHE_MODE: ${{ inputs.bazel-cache-mode }}
103105
- name: Post Build Disk Space
104106
shell: bash
105107
run: df -m

.github/workflows/windows-cmake.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,11 @@ jobs:
295295
run: |
296296
cd "${TEMP}"
297297
mkdir -p .build/vcpkg
298-
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${{ steps.dynamic.outputs.vcpkg-version }}.tar.gz" |
298+
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${STEPS_DYNAMIC_OUTPUTS_VCPKG_VERSION}.tar.gz" |
299299
tar -C .build/vcpkg --strip-components=1 -zxf -
300300
.build/vcpkg/bootstrap-vcpkg.sh -disableMetrics
301+
env:
302+
STEPS_DYNAMIC_OUTPUTS_VCPKG_VERSION: ${{ steps.dynamic.outputs.vcpkg-version }}
301303
# go/github-actions#gha-bestpractices explains why we use a SHA instead of
302304
# a named version for this runner. We could avoid using this runner with the
303305
# ideas from:
@@ -311,12 +313,15 @@ jobs:
311313
shell: bash
312314
run: |
313315
export VCPKG_ROOT="${TEMP}/.build/vcpkg"
314-
export CLOUDSDK_PYTHON="${{ steps.py311.outputs.python-path }}"
316+
export CLOUDSDK_PYTHON="${STEPS_PY311_OUTPUTS_PYTHON_PATH}"
315317
# Put the CMake output in a directory with more space and keep it short
316318
# to avoid running into the MSVC limits.
317319
export CMAKE_OUT='c:\b'
318320
export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }}
319-
ci/gha/builds/windows-cmake.sh ${{ matrix.build_type }} ${{ steps.dynamic.outputs.features }}
321+
ci/gha/builds/windows-cmake.sh ${{ matrix.build_type }} ${STEPS_DYNAMIC_OUTPUTS_FEATURES}
322+
env:
323+
STEPS_PY311_OUTPUTS_PYTHON_PATH: ${{ steps.py311.outputs.python-path }}
324+
STEPS_DYNAMIC_OUTPUTS_FEATURES: ${{ steps.dynamic.outputs.features }}
320325
- name: Post Build Disk Space
321326
shell: bash
322327
run: df -m

0 commit comments

Comments
 (0)