-
Notifications
You must be signed in to change notification settings - Fork 11
48 lines (41 loc) · 1.43 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
name: Bazel build and test
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
container: gcr.io/gapic-images/googleapis-bazel:20210105
# Dockerfile for this image is here:
# https://github.com/googleapis/googleapis-discovery/blob/main/Dockerfile
# If you update its version, please also update it below in
# 'Cache Bazel files' - unfortunately it cannot accept variables at this
# time.
steps:
- uses: actions/checkout@v4
- name: Cache Bazel files
id: cache-bazel
uses: actions/cache@v4
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-bazel-20210105-${{ secrets.CACHE_VERSION }}
- name: Cache not found
if: steps.cache-bazel.outputs.cache-hit != 'true'
run: |
echo "No cache found."
- name: 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/disco-to-proto3-converter/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 build
run: bazel build '//...'
- name: Run bazel test
run: bazel test '//...'