Skip to content

Commit ec2dcf9

Browse files
committed
ci: Add a job to populate the matrix with default values
1 parent 6a28d36 commit ec2dcf9

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

.github/workflows/downstream_protobuf_source_compatibility_check_nightly.yaml renamed to .github/workflows/downstream_protobuf_compatibility_check_nightly.yaml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,26 @@ on:
22
workflow_dispatch:
33
inputs:
44
protobuf_versions:
5-
description: 'Comma separated list of Protobuf-Java versions (i.e. "3.25.5","4.28.3")'
6-
# Default value for workflow_dispatch flow. If updating default value, update below as well.
7-
default: '"3.25.5","4.28.3"'
5+
description: 'Comma separated list of Protobuf-Java versions (i.e. "3.25.x","4.x.y")'
86
required: true
97
schedule:
108
- cron: '0 1 * * *' # Nightly at 1am
119

12-
name: Downstream Source Compatibility Nightly
10+
name: Downstream Compatibility Nightly
1311
jobs:
14-
downstream-protobuf-source-test:
12+
#
13+
define-matrix:
1514
runs-on: ubuntu-22.04
15+
outputs:
16+
protobuf-version: ${{ steps.protobuf-versions.outputs.protobuf-versions }}
17+
steps:
18+
- name: Default Protobuf Versions
19+
id: protobuf-versions
20+
run: |
21+
echo 'protobuf-versions=["3.25.4","4.28.3"]' >> "${GITHUB_OUTPUT}"
22+
downstream-protobuf-test:
23+
runs-on: ubuntu-22.04
24+
needs: define-matrix
1625
strategy:
1726
fail-fast: false
1827
matrix:
@@ -31,16 +40,15 @@ jobs:
3140
- java-spanner
3241
- java-storage
3342
- java-storage-nio
34-
# Specify the Protobuf versions here as well because the default values above are only supplied from
35-
# the workflow_dispatch flow. Without this, the nightly workflow doesn't have a default input otherwise
36-
# and would resolve to ''. When updating, update both places to keep default values consistent.
37-
protobuf-version: ${{ fromJSON(format('[{0}]', inputs.protobuf_versions || '"3.25.5","4.28.3"')) }}
43+
# Default values are specified from the `protobuf-versions` step in the `define-matrix` job. Without this,
44+
# the nightly workflow doesn't have a default input and would resolve to ''.
45+
protobuf-version: ${{ fromJSON(format('[{0}]', inputs.protobuf_versions || needs.define-matrix.outputs.protobuf-versions)) }}
3846
steps:
3947
- uses: actions/checkout@v3
4048
- uses: actions/setup-java@v3
4149
with:
4250
java-version: 17
4351
distribution: temurin
44-
- run: mvn -version
45-
- name: Perform downstream compatibility testing
52+
- run: echo "Testing with Protobuf-Java v${{ matrix.protobuf-version }}"
53+
- name: Perform downstream source compatibility testing
4654
run: REPOS_UNDER_TEST="${{ matrix.repo }}" PROTOBUF_RUNTIME_VERSION="${{ matrix.protobuf-version}}" ./.kokoro/presubmit/downstream-protobuf-source-compatibility.sh

.kokoro/presubmit/downstream-protobuf-source-compatibility.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ source "$scriptDir/common.sh"
3434

3535
setup_maven_mirror
3636

37-
echo "Testing with Protobuf-Java v${PROTOBUF_RUNTIME_VERSION}"
38-
3937
for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
4038
# Perform source-compatibility testing on main (latest changes)
4139
git clone "https://github.com/googleapis/$repo.git" --depth=1

0 commit comments

Comments
 (0)