Skip to content

Commit e2200d4

Browse files
Refactor Github Action per b/485167538
1 parent dd553bd commit e2200d4

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
@@ -70,9 +70,11 @@ jobs:
7070
# Using a short name like this avoids the problem in most cases.
7171
mkdir -p 'c:\b' || true
7272
export BAZEL_ROOT='c:\b'
73-
export BAZEL_REMOTE_CACHE_RW_MODE=${{ inputs.bazel-cache-mode }}
73+
export BAZEL_REMOTE_CACHE_RW_MODE=${INPUTS_BAZEL_CACHE_MODE}
7474
export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }}
7575
ci/gha/builds/windows-bazel.sh ${{ matrix.compilation_mode }} ${{ join(matrix.targets, ' ') }}
76+
env:
77+
INPUTS_BAZEL_CACHE_MODE: ${{ inputs.bazel-cache-mode }}
7678
- name: Post Build Disk Space
7779
shell: bash
7880
run: df -m

.github/workflows/windows-cmake.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,11 @@ jobs:
300300
run: |
301301
cd "${TEMP}"
302302
mkdir -p .build/vcpkg
303-
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${{ steps.dynamic.outputs.vcpkg-version }}.tar.gz" |
303+
curl -fsSL "https://github.com/microsoft/vcpkg/archive/${STEPS_DYNAMIC_OUTPUTS_VCPKG_VERSION}.tar.gz" |
304304
tar -C .build/vcpkg --strip-components=1 -zxf -
305305
.build/vcpkg/bootstrap-vcpkg.sh -disableMetrics
306+
env:
307+
STEPS_DYNAMIC_OUTPUTS_VCPKG_VERSION: ${{ steps.dynamic.outputs.vcpkg-version }}
306308
# go/github-actions#gha-bestpractices explains why we use a SHA instead of
307309
# a named version for this runner. We could avoid using this runner with the
308310
# ideas from:
@@ -316,12 +318,15 @@ jobs:
316318
shell: bash
317319
run: |
318320
export VCPKG_ROOT="${TEMP}/.build/vcpkg"
319-
export CLOUDSDK_PYTHON="${{ steps.py311.outputs.python-path }}"
321+
export CLOUDSDK_PYTHON="${STEPS_PY311_OUTPUTS_PYTHON_PATH}"
320322
# Put the CMake output in a directory with more space and keep it short
321323
# to avoid running into the MSVC limits.
322324
export CMAKE_OUT='c:\b'
323325
export EXECUTE_INTEGRATION_TESTS=${{ inputs.execute-integration-tests }}
324-
ci/gha/builds/windows-cmake.sh ${{ matrix.build_type }} ${{ steps.dynamic.outputs.features }}
326+
ci/gha/builds/windows-cmake.sh ${{ matrix.build_type }} ${STEPS_DYNAMIC_OUTPUTS_FEATURES}
327+
env:
328+
STEPS_PY311_OUTPUTS_PYTHON_PATH: ${{ steps.py311.outputs.python-path }}
329+
STEPS_DYNAMIC_OUTPUTS_FEATURES: ${{ steps.dynamic.outputs.features }}
325330
- name: Post Build Disk Space
326331
shell: bash
327332
run: df -m

0 commit comments

Comments
 (0)