Skip to content

Commit dd1f514

Browse files
committed
ci: configure the protected branch
1 parent 724e74f commit dd1f514

File tree

3 files changed

+264
-274
lines changed

3 files changed

+264
-274
lines changed

.github/workflows/ci-java7.yaml

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,60 @@
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+
- 1.47.x
5+
pull_request: null
216
name: ci-java7
227
jobs:
238
units:
24-
name: "units (7)"
9+
name: units (7)
2510
runs-on: ubuntu-latest
2611
steps:
27-
- uses: actions/checkout@v4
28-
- uses: actions/setup-java@v4
29-
# setup-java v2 or higher does not have version 1.7
30-
with:
31-
java-version: 7
32-
distribution: zulu
33-
architecture: x64
34-
- run: |
35-
java -version
36-
# This value is used in "-Djvm=" later
37-
echo "JAVA7_HOME=${JAVA_HOME}" >> $GITHUB_ENV
38-
- uses: actions/setup-java@v4
39-
with:
40-
java-version: 17
41-
distribution: zulu
42-
- name: Set up Maven
43-
uses: stCarolas/[email protected]
44-
with:
45-
maven-version: 3.8.8
46-
- name: Build
47-
shell: bash
48-
run: |
49-
# Leveraging surefire's jvm option, running the test on Java 7.
50-
# Surefire plugin 2.22.2 is the last version for Java 7. Newer version would fail with
51-
# "UnsupportedClassVersionError: org/apache/maven/surefire/booter/ForkedBooter" error.
52-
53-
# Why are these modules are skipped?
54-
# google-http-client-jackson2 and google-http-client-appengine do not work with Java 7
55-
# any more because of Jackson and appengine library are compiled for Java 8.
56-
# dailymotion-simple-cmdline-sample and google-http-client-assembly depend on
57-
# google-http-client-jackson2
58-
mvn --batch-mode --show-version -ntp test \
59-
--projects '!google-http-client-jackson2,!google-http-client-appengine,!samples/dailymotion-simple-cmdline-sample,!google-http-client-assembly,!google-http-client-apache-v5' \
60-
-Dclirr.skip=true -Denforcer.skip=true -Dmaven.javadoc.skip=true \
61-
-Dgcloud.download.skip=true -T 1C \
62-
-Dproject.surefire.version=2.22.2 \
63-
-Djvm=${JAVA7_HOME}/bin/java
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-java@v4
14+
with:
15+
java-version: 7
16+
distribution: zulu
17+
architecture: x64
18+
- run: |
19+
java -version
20+
# This value is used in "-Djvm=" later
21+
echo "JAVA7_HOME=${JAVA_HOME}" >> $GITHUB_ENV
22+
- uses: actions/setup-java@v4
23+
with:
24+
java-version: 17
25+
distribution: zulu
26+
- name: Set up Maven
27+
uses: stCarolas/[email protected]
28+
with:
29+
maven-version: 3.8.8
30+
- name: Build
31+
shell: bash
32+
run: >
33+
# Leveraging surefire's jvm option, running the test on Java 7.
34+
35+
# Surefire plugin 2.22.2 is the last version for Java 7. Newer version
36+
would fail with
37+
38+
# "UnsupportedClassVersionError:
39+
org/apache/maven/surefire/booter/ForkedBooter" error.
40+
41+
42+
# Why are these modules are skipped?
43+
44+
# google-http-client-jackson2 and google-http-client-appengine do not
45+
work with Java 7
46+
47+
# any more because of Jackson and appengine library are compiled for
48+
Java 8.
49+
50+
# dailymotion-simple-cmdline-sample and google-http-client-assembly
51+
depend on
52+
53+
# google-http-client-jackson2
54+
55+
mvn --batch-mode --show-version -ntp test \
56+
--projects '!google-http-client-jackson2,!google-http-client-appengine,!samples/dailymotion-simple-cmdline-sample,!google-http-client-assembly,!google-http-client-apache-v5' \
57+
-Dclirr.skip=true -Denforcer.skip=true -Dmaven.javadoc.skip=true \
58+
-Dgcloud.download.skip=true -T 1C \
59+
-Dproject.surefire.version=2.22.2 \
60+
-Djvm=${JAVA7_HOME}/bin/java

.github/workflows/ci.yaml

Lines changed: 76 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,103 @@
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+
- 1.47.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: [8, 11, 17, 24]
13+
java:
14+
- 8
15+
- 11
16+
- 17
17+
- 24
2918
steps:
30-
- uses: actions/checkout@v4
31-
- uses: actions/setup-java@v4
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
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-java@v4
21+
with:
22+
distribution: temurin
23+
java-version: ${{matrix.java}}
24+
- run: java -version
25+
- run: .kokoro/build.sh
26+
env:
27+
JOB_TYPE: test
3928
windows:
4029
runs-on: windows-latest
4130
steps:
42-
- name: Support longpaths
43-
run: git config --system core.longpaths true
44-
- uses: actions/checkout@v4
45-
- uses: actions/setup-java@v4
46-
with:
47-
distribution: temurin
48-
java-version: 8
49-
- run: java -version
50-
- run: .kokoro/build.bat
51-
env:
52-
JOB_TYPE: test
31+
- name: Support longpaths
32+
run: git config --system core.longpaths true
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-java@v4
35+
with:
36+
distribution: temurin
37+
java-version: 8
38+
- run: java -version
39+
- run: .kokoro/build.bat
40+
env:
41+
JOB_TYPE: test
5342
dependencies:
5443
runs-on: ubuntu-latest
5544
strategy:
5645
matrix:
57-
java: [8, 11, 17, 24]
46+
java:
47+
- 8
48+
- 11
49+
- 17
50+
- 24
5851
steps:
59-
- uses: actions/checkout@v4
60-
- uses: actions/setup-java@v4
61-
with:
62-
distribution: temurin
63-
java-version: ${{matrix.java}}
64-
- run: java -version
65-
- run: .kokoro/dependencies.sh
52+
- uses: actions/checkout@v4
53+
- uses: actions/setup-java@v4
54+
with:
55+
distribution: temurin
56+
java-version: ${{matrix.java}}
57+
- run: java -version
58+
- run: .kokoro/dependencies.sh
6659
lint:
6760
runs-on: ubuntu-latest
6861
steps:
69-
- uses: actions/checkout@v4
70-
- uses: actions/setup-java@v4
71-
with:
72-
distribution: temurin
73-
java-version: 11
74-
- run: java -version
75-
- run: .kokoro/build.sh
76-
env:
77-
JOB_TYPE: lint
62+
- uses: actions/checkout@v4
63+
- uses: actions/setup-java@v4
64+
with:
65+
distribution: temurin
66+
java-version: 11
67+
- run: java -version
68+
- run: .kokoro/build.sh
69+
env:
70+
JOB_TYPE: lint
7871
clirr:
7972
runs-on: ubuntu-latest
8073
steps:
81-
- uses: actions/checkout@v4
82-
- uses: actions/setup-java@v4
83-
with:
84-
distribution: temurin
85-
java-version: 8
86-
- run: java -version
87-
- run: .kokoro/build.sh
88-
env:
89-
JOB_TYPE: clirr
90-
# compilation failure for sub-modules using source and target options 7 (this setting cannot be upgraded to Java 21 because some modules support max of Java 8)
91-
# Hence compile in Java 8 and test in Java 21.
74+
- uses: actions/checkout@v4
75+
- uses: actions/setup-java@v4
76+
with:
77+
distribution: temurin
78+
java-version: 8
79+
- run: java -version
80+
- run: .kokoro/build.sh
81+
env:
82+
JOB_TYPE: clirr
9283
units-java21:
93-
# Building using Java 8 and run the tests with Java 21 runtime
94-
name: "units (21)"
84+
name: units (21)
9585
runs-on: ubuntu-latest
9686
steps:
97-
- uses: actions/checkout@v4
98-
- uses: actions/setup-java@v4
99-
with:
100-
java-version: 21
101-
distribution: temurin
102-
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
103-
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
104-
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
105-
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
106-
shell: bash
107-
- uses: actions/setup-java@v4
108-
with:
109-
java-version: 8
110-
distribution: temurin
111-
- run: .kokoro/build.sh
112-
env:
113-
JOB_TYPE: test
87+
- uses: actions/checkout@v4
88+
- uses: actions/setup-java@v4
89+
with:
90+
java-version: 21
91+
distribution: temurin
92+
- name: >-
93+
Set jvm system property environment variable for surefire plugin (unit
94+
tests)
95+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
96+
shell: bash
97+
- uses: actions/setup-java@v4
98+
with:
99+
java-version: 8
100+
distribution: temurin
101+
- run: .kokoro/build.sh
102+
env:
103+
JOB_TYPE: test

0 commit comments

Comments
 (0)