Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Commit f7caf21

Browse files
authored
ci: configure the protected branch (#1868)
1 parent 9bea140 commit f7caf21

File tree

4 files changed

+208
-214
lines changed

4 files changed

+208
-214
lines changed

.github/workflows/ci.yaml

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
on:
1+
'on':
22
push:
33
branches:
4-
- main
5-
pull_request:
4+
- 2.19.x
5+
pull_request: null
66
name: ci
77
jobs:
88
clirr:
@@ -23,26 +23,26 @@ jobs:
2323
env:
2424
JOB_TYPE: clirr
2525
maven-units:
26-
name: "maven unit tests"
26+
name: maven unit tests
2727
runs-on: ubuntu-latest
2828
steps:
29-
- uses: actions/checkout@v3
30-
- uses: actions/setup-java@v3
31-
with:
32-
java-version: 8
33-
distribution: zulu
34-
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
35-
- uses: actions/setup-java@v3
36-
with:
37-
java-version: 11
38-
distribution: zulu
39-
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
40-
- run: printenv
41-
- run: .kokoro/maven-build.sh
42-
env:
43-
JOB_TYPE: test
29+
- uses: actions/checkout@v3
30+
- uses: actions/setup-java@v3
31+
with:
32+
java-version: 8
33+
distribution: zulu
34+
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
35+
- uses: actions/setup-java@v3
36+
with:
37+
java-version: 11
38+
distribution: zulu
39+
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
40+
- run: printenv
41+
- run: .kokoro/maven-build.sh
42+
env:
43+
JOB_TYPE: test
4444
units-java11:
45-
name: "units (11)"
45+
name: units (11)
4646
runs-on: ubuntu-latest
4747
steps:
4848
- uses: actions/checkout@v3
@@ -55,66 +55,64 @@ jobs:
5555
env:
5656
JOB_TYPE: test
5757
units-java8:
58-
name: "units (8)"
58+
name: units (8)
5959
runs-on: ubuntu-latest
6060
steps:
61-
- uses: actions/checkout@v3
62-
# Java 8 tests uses JDK 11 to compile and JDK 8 to run tests. See .kokoro/
63-
# build.sh for the setup.
64-
- uses: actions/setup-java@v3
65-
with:
66-
java-version: 8
67-
distribution: zulu
68-
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
69-
- uses: actions/setup-java@v3
70-
with:
71-
java-version: 11
72-
distribution: zulu
73-
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
74-
- run: printenv
75-
- run: .kokoro/build.sh
76-
env:
77-
JOB_TYPE: test
61+
- uses: actions/checkout@v3
62+
- uses: actions/setup-java@v3
63+
with:
64+
java-version: 8
65+
distribution: zulu
66+
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
67+
- uses: actions/setup-java@v3
68+
with:
69+
java-version: 11
70+
distribution: zulu
71+
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
72+
- run: printenv
73+
- run: .kokoro/build.sh
74+
env:
75+
JOB_TYPE: test
7876
bazel:
7977
runs-on: ubuntu-latest
80-
# Not using a container. The ubuntu-latest has Bazel 4.2 installed as of
81-
# November 2021. gRPC 1.42 requires Bazel 4.
82-
# https://github.com/grpc/grpc-java/pull/7598
8378
steps:
8479
- uses: actions/checkout@v2
8580
- uses: actions/setup-java@v1
8681
with:
8782
java-version: 8
8883
- run: java -version
89-
9084
- name: Bazel File Cache Setup
9185
id: cache-bazel
9286
uses: actions/cache@v3
9387
with:
9488
path: ~/.cache/bazel
9589
key: ${{ runner.os }}-bazel-20210105-${{ secrets.CACHE_VERSION }}
96-
9790
- name: Bazel Cache Not Found
9891
if: steps.cache-bazel.outputs.cache-hit != 'true'
9992
run: |
10093
echo "No cache found."
10194
- name: Bazel Cache Found
10295
if: steps.cache-bazel.outputs.cache-hit == 'true'
103-
run: |
96+
run: >
10497
echo -n "Cache found. Cache size: "
98+
10599
du -sh ~/.cache/bazel
100+
106101
echo "If the cache seems broken, update the CACHE_VERSION secret in"
107-
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
102+
103+
echo
104+
"https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
105+
108106
echo "(use any random string, any GUID will work)"
107+
109108
echo "and it will start over with a clean cache."
110-
echo "The old one will disappear after 7 days."
111109
110+
echo "The old one will disappear after 7 days."
112111
- name: Run bazel tests
113112
run: |
114113
which bazel
115114
bazel --version
116115
bazel --batch test //... --noshow_progress --test_output=errors
117-
118116
- uses: actions/upload-artifact@v3
119117
if: ${{ failure() }}
120118
with:
Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,33 @@
1-
on:
1+
'on':
22
push:
33
branches:
4-
- main
5-
pull_request:
6-
7-
# Keeping this file separate as the dependencies check would use more
8-
# repositories than needed this downstream check for GraalVM native image
9-
# compilation.
4+
- 2.19.x
5+
pull_request: null
106
name: downstream
117
jobs:
12-
# GraalVM job ensures the compatibility of GraaVM version
138
graalvm:
149
runs-on: ubuntu-latest
1510
strategy:
1611
fail-fast: false
1712
matrix:
18-
graalvm: [22.2.0]
19-
java: [11, 17]
13+
graalvm:
14+
- 22.2.0
15+
java:
16+
- 11
17+
- 17
2018
repo:
21-
# GAPIC library that doesn't use a real GCP project in integration tests
22-
- orgpolicy
19+
- orgpolicy
2320
steps:
24-
- uses: actions/checkout@v2
25-
- uses: stCarolas/setup-maven@v4
26-
with:
27-
maven-version: 3.8.1
28-
- uses: ayltai/setup-graalvm@v1
29-
with:
30-
java-version: ${{matrix.java}}
31-
# When a new version of native-maven-plugin fails to run in a downstream
32-
# library, it's likely to be an incompatibility with the GraalVM version.
33-
# In that case, you need to upgrade the Docker container used in the
34-
# tests in the downstream repositories (not just this value below).
35-
# Example: https://github.com/googleapis/testing-infra-docker/pull/195
36-
graalvm-version: ${{matrix.graalvm}}
37-
native-image: true
38-
- run: java -version
39-
- run: sudo apt-get update -y
40-
- run: sudo apt-get install libxml2-utils
41-
- run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} graalvm
21+
- uses: actions/checkout@v2
22+
- uses: stCarolas/setup-maven@v4
23+
with:
24+
maven-version: 3.8.1
25+
- uses: ayltai/setup-graalvm@v1
26+
with:
27+
java-version: ${{matrix.java}}
28+
graalvm-version: ${{matrix.graalvm}}
29+
native-image: true
30+
- run: java -version
31+
- run: sudo apt-get update -y
32+
- run: sudo apt-get install libxml2-utils
33+
- run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} graalvm

0 commit comments

Comments
 (0)