Skip to content

Commit cad44f2

Browse files
committed
ci: configure the protected branch
1 parent 9cd7806 commit cad44f2

File tree

2 files changed

+240
-209
lines changed

2 files changed

+240
-209
lines changed

.github/workflows/ci.yaml

Lines changed: 105 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,139 @@
1-
on:
1+
'on':
22
push:
33
branches:
4-
- main
5-
pull_request:
4+
- 2.7.x
5+
pull_request: null
66
name: ci
77
jobs:
88
units:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
java: [8, 11]
12+
java:
13+
- 8
14+
- 11
1315
steps:
14-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15-
- uses: actions/setup-java@v1
16-
with:
17-
java-version: ${{matrix.java}}
18-
- run: java -version
19-
- run: .kokoro/install_dependencies.sh
20-
- run: .kokoro/build.sh
21-
env:
22-
JOB_TYPE: test
23-
# The `envVarTest` profile runs tests that require an environment variable
24-
- name: Env Var Tests
25-
run: |
26-
mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true -PenvVarTest
27-
# Set the Env Var for this step only
28-
env:
29-
GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
17+
- uses: actions/setup-java@v1
18+
with:
19+
java-version: ${{matrix.java}}
20+
- run: java -version
21+
- run: .kokoro/install_dependencies.sh
22+
- run: .kokoro/build.sh
23+
env:
24+
JOB_TYPE: test
25+
- name: Env Var Tests
26+
run: |
27+
mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true -PenvVarTest
28+
env:
29+
GOOGLE_CLOUD_UNIVERSE_DOMAIN: random.com
3030
windows:
3131
runs-on: windows-latest
3232
steps:
33-
- name: git configuration to avoid automatic CRLF conversion
34-
run: |
35-
git config --global core.autocrlf false
36-
git config --global core.eol lf
37-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
38-
- uses: actions/setup-java@v1
39-
with:
40-
java-version: 8
41-
- run: java -version
42-
- name: Install google-play-services artifact
43-
shell: bash
44-
run: |
45-
mkdir play-services
46-
cd play-services
47-
curl --output play-services-basement-8.3.0.aar https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-basement/8.3.0/play-services-basement-8.3.0.aar
48-
unzip play-services-basement-8.3.0.aar
49-
mvn install:install-file \
50-
-Dfile=classes.jar \
51-
-DgroupId=com.google.android.google-play-services \
52-
-DartifactId=google-play-services \
53-
-Dversion=1 \
54-
-Dpackaging=jar
55-
- run: .kokoro/build.sh
56-
shell: bash
57-
env:
58-
JOB_TYPE: test
33+
- name: git configuration to avoid automatic CRLF conversion
34+
run: |
35+
git config --global core.autocrlf false
36+
git config --global core.eol lf
37+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
38+
- uses: actions/setup-java@v1
39+
with:
40+
java-version: 8
41+
- run: java -version
42+
- name: Install google-play-services artifact
43+
shell: bash
44+
run: >
45+
mkdir play-services
46+
47+
cd play-services
48+
49+
curl --output play-services-basement-8.3.0.aar
50+
https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-basement/8.3.0/play-services-basement-8.3.0.aar
51+
52+
unzip play-services-basement-8.3.0.aar
53+
54+
mvn install:install-file \
55+
-Dfile=classes.jar \
56+
-DgroupId=com.google.android.google-play-services \
57+
-DartifactId=google-play-services \
58+
-Dversion=1 \
59+
-Dpackaging=jar
60+
- run: .kokoro/build.sh
61+
shell: bash
62+
env:
63+
JOB_TYPE: test
5964
dependencies:
6065
runs-on: ubuntu-latest
6166
strategy:
6267
matrix:
63-
java: [8, 11]
68+
java:
69+
- 8
70+
- 11
6471
steps:
65-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
66-
- uses: actions/setup-java@v1
67-
with:
68-
java-version: ${{matrix.java}}
69-
- run: java -version
70-
- run: .kokoro/install_dependencies.sh
71-
- run: .kokoro/dependencies.sh
72+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
73+
- uses: actions/setup-java@v1
74+
with:
75+
java-version: ${{matrix.java}}
76+
- run: java -version
77+
- run: .kokoro/install_dependencies.sh
78+
- run: .kokoro/dependencies.sh
7279
lint:
7380
runs-on: ubuntu-latest
7481
steps:
75-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
76-
- uses: actions/setup-java@v1
77-
with:
78-
java-version: 11
79-
- run: java -version
80-
- run: .kokoro/install_dependencies.sh
81-
- run: .kokoro/build.sh
82-
env:
83-
JOB_TYPE: lint
82+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
83+
- uses: actions/setup-java@v1
84+
with:
85+
java-version: 11
86+
- run: java -version
87+
- run: .kokoro/install_dependencies.sh
88+
- run: .kokoro/build.sh
89+
env:
90+
JOB_TYPE: lint
8491
clirr:
8592
runs-on: ubuntu-latest
8693
steps:
87-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
88-
- uses: actions/setup-java@v1
89-
with:
90-
java-version: 8
91-
- run: java -version
92-
- run: .kokoro/install_dependencies.sh
93-
- run: .kokoro/build.sh
94-
env:
95-
JOB_TYPE: clirr
96-
94+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
95+
- uses: actions/setup-java@v1
96+
with:
97+
java-version: 8
98+
- run: java -version
99+
- run: .kokoro/install_dependencies.sh
100+
- run: .kokoro/build.sh
101+
env:
102+
JOB_TYPE: clirr
97103
units-java21:
98-
# Building using Java 8 and run the tests with Java 21 runtime
99-
name: "units (21)"
104+
name: units (21)
100105
runs-on: ubuntu-latest
101106
steps:
102107
- uses: actions/checkout@v4
103108
- uses: actions/setup-java@v3
104109
with:
105110
java-version: 21
106111
distribution: temurin
107-
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
108-
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
109-
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
112+
- name: >-
113+
Set jvm system property environment variable for surefire plugin (unit
114+
tests)
115+
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
116+
shell: bash
117+
- uses: actions/setup-java@v3
118+
with:
119+
java-version: 8
120+
distribution: temurin
121+
- run: .kokoro/install_dependencies.sh
122+
- run: .kokoro/build.sh
123+
env:
124+
JOB_TYPE: test
125+
units-java24:
126+
name: units (24)
127+
runs-on: ubuntu-latest
128+
steps:
129+
- uses: actions/checkout@v4
130+
- uses: actions/setup-java@v3
131+
with:
132+
java-version: 24
133+
distribution: temurin
134+
- name: >-
135+
Set jvm system property environment variable for surefire plugin (unit
136+
tests)
110137
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
111138
shell: bash
112139
- uses: actions/setup-java@v3

0 commit comments

Comments
 (0)