Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

Commit ceb033e

Browse files
authored
ci: configure the protected branch (#7378)
1 parent e2e00b5 commit ceb033e

4 files changed

Lines changed: 152 additions & 178 deletions

File tree

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,47 @@
1-
on:
1+
'on':
22
push:
33
branches:
4-
- main
5-
pull_request:
4+
- 26.75.x
5+
pull_request: null
66
name: ci
77
jobs:
88
bom-content-test:
99
runs-on: ubuntu-latest
1010
if: github.repository_owner == 'googleapis'
1111
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-java@v5
14-
with:
15-
distribution: temurin
16-
java-version: 11
17-
cache: maven
18-
- run: java -version
19-
- name: Install BOMs
20-
run: |
21-
mvn -B -V -ntp install
22-
- name: Ensure the members of the Libraries BOM exist in Maven Central
23-
uses: ./tests/validate-bom
24-
with:
25-
bom-path: libraries-bom/pom.xml
26-
- name: Ensure the BOM has valid content (at releases)
27-
if: github.head_ref == 'release-please--branches--main'
28-
run: |
29-
mvn -B -V -ntp verify -Dtest="BomContentTest#testLibrariesBom"
30-
working-directory: tests
31-
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-java@v5
14+
with:
15+
distribution: temurin
16+
java-version: 11
17+
cache: maven
18+
- run: java -version
19+
- name: Install BOMs
20+
run: |
21+
mvn -B -V -ntp install
22+
- name: Ensure the members of the Libraries BOM exist in Maven Central
23+
uses: ./tests/validate-bom
24+
with:
25+
bom-path: libraries-bom/pom.xml
26+
- name: Ensure the BOM has valid content (at releases)
27+
if: github.head_ref == 'release-please--branches--main'
28+
run: |
29+
mvn -B -V -ntp verify -Dtest="BomContentTest#testLibrariesBom"
30+
working-directory: tests
3231
bom-assertion-test:
3332
name: BomContentAssertionsTest (Test for assertion logic in BomContentTest)
3433
runs-on: ubuntu-latest
3534
if: github.repository_owner == 'googleapis'
3635
steps:
37-
- uses: actions/checkout@v4
38-
- uses: actions/setup-java@v5
39-
with:
40-
distribution: zulu
41-
java-version: 8
42-
- run: java -version
43-
- name: Install BOMs
44-
run: |
45-
mvn -B -V -ntp install
46-
- run: |
47-
mvn -B -V -ntp verify -Dtest="BomContentAssertionsTest"
48-
working-directory: tests
49-
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-java@v5
38+
with:
39+
distribution: zulu
40+
java-version: 8
41+
- run: java -version
42+
- name: Install BOMs
43+
run: |
44+
mvn -B -V -ntp install
45+
- run: |
46+
mvn -B -V -ntp verify -Dtest="BomContentAssertionsTest"
47+
working-directory: tests
Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,32 @@
1-
# Copyright 2023 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
# Github action job to test core java library features on
15-
# downstream client libraries before they are released.
16-
on:
1+
'on':
172
push:
183
branches:
19-
- main
20-
pull_request:
4+
- 26.75.x
5+
pull_request: null
216
name: test for tests/validate-bom logic
227
jobs:
238
test-invalid-bom:
249
runs-on: ubuntu-latest
2510
steps:
26-
- uses: actions/checkout@v4
27-
- name: Fetch the bad protobuf-bom version 3.22.1
28-
shell: bash
29-
# 3.22.1 had a issue in their pom.xml
30-
# https://github.com/protocolbuffers/protobuf/issues/12170
31-
run: |
32-
mkdir -p bad-protobuf-bom
33-
curl https://repo1.maven.org/maven2/com/google/protobuf/protobuf-bom/3.22.1/protobuf-bom-3.22.1.pom \
34-
--output bad-protobuf-bom/pom.xml
35-
- name: Check the bad BOM
36-
uses: ./tests/validate-bom
37-
id: validate-bom
38-
with:
39-
bom-path: bad-protobuf-bom/pom.xml
40-
continue-on-error: true
41-
- name: Ensure the validate-bom invalidated the bad BOM
42-
shell: bash
43-
if: steps.validate-bom.outcome != 'failure'
44-
run: |
45-
echo "The validate-bom check should have invalidated the bad BOM"
46-
exit 1
11+
- uses: actions/checkout@v4
12+
- name: Fetch the bad protobuf-bom version 3.22.1
13+
shell: bash
14+
run: >
15+
mkdir -p bad-protobuf-bom
16+
17+
curl
18+
https://repo1.maven.org/maven2/com/google/protobuf/protobuf-bom/3.22.1/protobuf-bom-3.22.1.pom
19+
\
20+
--output bad-protobuf-bom/pom.xml
21+
- name: Check the bad BOM
22+
uses: ./tests/validate-bom
23+
id: validate-bom
24+
with:
25+
bom-path: bad-protobuf-bom/pom.xml
26+
continue-on-error: true
27+
- name: Ensure the validate-bom invalidated the bad BOM
28+
shell: bash
29+
if: steps.validate-bom.outcome != 'failure'
30+
run: |
31+
echo "The validate-bom check should have invalidated the bad BOM"
32+
exit 1

.github/workflows/ci.yaml

Lines changed: 67 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,41 @@
1-
# Copyright 2022 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
# Github action job to test core java library features on
15-
# downstream client libraries before they are released.
16-
on:
1+
'on':
172
push:
183
branches:
19-
- main
20-
pull_request:
4+
- 26.75.x
5+
pull_request: null
216
name: ci
227
jobs:
238
units:
249
runs-on: ubuntu-latest
2510
strategy:
2611
fail-fast: false
2712
matrix:
28-
java: [11, 17, 21]
13+
java:
14+
- 11
15+
- 17
16+
- 21
2917
steps:
30-
- uses: actions/checkout@v4
31-
- uses: actions/setup-java@v5
32-
with:
33-
distribution: temurin
34-
java-version: ${{matrix.java}}
35-
- run: java -version
36-
- run: .kokoro/build.sh
37-
env:
38-
JOB_TYPE: test
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-java@v5
20+
with:
21+
distribution: temurin
22+
java-version: ${{matrix.java}}
23+
- run: java -version
24+
- run: .kokoro/build.sh
25+
env:
26+
JOB_TYPE: test
3927
units-java8:
40-
# Building using Java 17 and run the tests with Java 8 runtime
41-
name: "units (8)"
28+
name: units (8)
4229
runs-on: ubuntu-latest
4330
steps:
4431
- uses: actions/checkout@v4
4532
- uses: actions/setup-java@v5
4633
with:
4734
java-version: 8
4835
distribution: temurin
49-
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
50-
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
51-
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
36+
- name: >-
37+
Set jvm system property environment variable for surefire plugin (unit
38+
tests)
5239
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
5340
shell: bash
5441
- uses: actions/setup-java@v5
@@ -61,63 +48,64 @@ jobs:
6148
windows:
6249
runs-on: windows-latest
6350
steps:
64-
- name: Support longpaths
65-
run: git config --system core.longpaths true
66-
- uses: actions/checkout@v4
67-
- uses: actions/setup-java@v5
68-
with:
69-
distribution: temurin
70-
java-version: 8
71-
- run: java -version
72-
- run: .kokoro/build.bat
73-
env:
74-
JOB_TYPE: test
51+
- name: Support longpaths
52+
run: git config --system core.longpaths true
53+
- uses: actions/checkout@v4
54+
- uses: actions/setup-java@v5
55+
with:
56+
distribution: temurin
57+
java-version: 8
58+
- run: java -version
59+
- run: .kokoro/build.bat
60+
env:
61+
JOB_TYPE: test
7562
dependencies:
7663
runs-on: ubuntu-latest
7764
strategy:
7865
matrix:
79-
java: [17]
66+
java:
67+
- 17
8068
steps:
81-
- uses: actions/checkout@v4
82-
- uses: actions/setup-java@v5
83-
with:
84-
distribution: temurin
85-
java-version: ${{matrix.java}}
86-
- run: java -version
87-
- run: .kokoro/dependencies.sh
69+
- uses: actions/checkout@v4
70+
- uses: actions/setup-java@v5
71+
with:
72+
distribution: temurin
73+
java-version: ${{matrix.java}}
74+
- run: java -version
75+
- run: .kokoro/dependencies.sh
8876
javadoc:
8977
runs-on: ubuntu-latest
9078
steps:
91-
- uses: actions/checkout@v4
92-
- uses: actions/setup-java@v5
93-
with:
94-
distribution: temurin
95-
java-version: 17
96-
- run: java -version
97-
- run: .kokoro/build.sh
98-
env:
99-
JOB_TYPE: javadoc
79+
- uses: actions/checkout@v4
80+
- uses: actions/setup-java@v5
81+
with:
82+
distribution: temurin
83+
java-version: 17
84+
- run: java -version
85+
- run: .kokoro/build.sh
86+
env:
87+
JOB_TYPE: javadoc
10088
lint:
10189
runs-on: ubuntu-latest
10290
steps:
103-
- uses: actions/checkout@v4
104-
- uses: actions/setup-java@v5
105-
with:
106-
distribution: temurin
107-
java-version: 11
108-
- run: java -version
109-
- run: .kokoro/build.sh
110-
env:
111-
JOB_TYPE: lint
91+
- uses: actions/checkout@v4
92+
- uses: actions/setup-java@v5
93+
with:
94+
distribution: temurin
95+
java-version: 11
96+
- run: java -version
97+
- run: .kokoro/build.sh
98+
env:
99+
JOB_TYPE: lint
112100
clirr:
113101
runs-on: ubuntu-latest
114102
steps:
115-
- uses: actions/checkout@v4
116-
- uses: actions/setup-java@v5
117-
with:
118-
distribution: temurin
119-
java-version: 8
120-
- run: java -version
121-
- run: .kokoro/build.sh
122-
env:
123-
JOB_TYPE: clirr
103+
- uses: actions/checkout@v4
104+
- uses: actions/setup-java@v5
105+
with:
106+
distribution: temurin
107+
java-version: 8
108+
- run: java -version
109+
- run: .kokoro/build.sh
110+
env:
111+
JOB_TYPE: clirr

0 commit comments

Comments
 (0)