Skip to content
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# For an overview of the syntax of this file, see
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions

name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-18.04

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, which is the CWD for
# the rest of the steps
- uses: actions/checkout@v2

# Caches and restores the bazel build directory.
- name: Cache bazel build results
uses: actions/[email protected]
env:
cache-name: bazel-cache
with:
path: ~/.cache/bazel
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.ref }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-master

- name: Build the code
run: bazel build ...

- name: Test the code
run: bazel test --test_output=errors --test_tag_filters=-integration-test ...