Skip to content

Commit 345df93

Browse files
committed
ci: configure the protected branch
1 parent 354bd1c commit 345df93

2 files changed

Lines changed: 211 additions & 218 deletions

File tree

.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+
- 2.1.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, 25]
13+
java:
14+
- 8
15+
- 11
16+
- 17
17+
- 25
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, 25]
46+
java:
47+
- 8
48+
- 11
49+
- 17
50+
- 25
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)