This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
113 lines (109 loc) · 3.32 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
on:
push:
branches:
- main
pull_request:
name: ci
jobs:
clirr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
- run: .kokoro/build.sh
env:
JOB_TYPE: clirr
units-java11:
name: "units (11)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: zulu
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: test
units-java8:
name: "units (8)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Java 8 tests uses JDK 11 to compile and JDK 8 to run tests. See .kokoro/
# build.sh for the setup.
- uses: actions/setup-java@v3
with:
java-version: 8
distribution: zulu
- run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: zulu
- run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV
- run: printenv
- run: .kokoro/build.sh
env:
JOB_TYPE: test
bazel:
runs-on: ubuntu-latest
# Not using a container. The ubuntu-latest has Bazel 4.2 installed as of
# November 2021. gRPC 1.42 requires Bazel 4.
# https://github.com/grpc/grpc-java/pull/7598
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- run: java -version
- name: Bazel File Cache Setup
id: cache-bazel
uses: actions/cache@v3
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-bazel-20210105-${{ secrets.CACHE_VERSION }}
- name: Bazel Cache Not Found
if: steps.cache-bazel.outputs.cache-hit != 'true'
run: |
echo "No cache found."
- name: Bazel Cache Found
if: steps.cache-bazel.outputs.cache-hit == 'true'
run: |
echo -n "Cache found. Cache size: "
du -sh ~/.cache/bazel
echo "If the cache seems broken, update the CACHE_VERSION secret in"
echo "https://github.com/googleapis/googleapis-discovery/settings/secrets/actions"
echo "(use any random string, any GUID will work)"
echo "and it will start over with a clean cache."
echo "The old one will disappear after 7 days."
- name: Run bazel tests
run: |
which bazel
bazel --version
bazel --batch test //... --noshow_progress --test_output=errors
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: test-artifacts
path: ~/.cache/bazel/*/*/*/gax-java/bazel-out/*/testlogs/*
retention-days: 5
requirements:
name: "requirements"
runs-on: ubuntu-latest
container: gcr.io/cloud-devrel-public-resources/java8
steps:
- uses: actions/checkout@v2
- run: |
python3 --version
python3 -m pip install --require-hashes -r .kokoro/requirements.txt