This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
68 lines (63 loc) · 1.97 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
on:
push:
branches:
- main
pull_request:
name: ci
jobs:
units:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- run: java -version
- 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@v2
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@v2
if: ${{ failure() }}
with:
name: test-artifacts
path: ~/.cache/bazel/*/*/*/gax-java/bazel-out/*/testlogs/*
retention-days: 5