name: Run all tests

on:
  push:
    branches:
      - main

jobs:
  run-go-tests:
    runs-on: ubuntu-latest
    steps:
      - name: Check out sources
        uses: actions/checkout@v2
      - name: Install Protobuf Compiler
        uses: arduino/setup-protoc@v1
        with:
          version: '3.x'
      - name: Set up Go environment
        uses: actions/setup-go@v2
        with:
          go-version: '^1.16'
      - name: Set up Protobuf Compiler in Go environment
        run: |
          go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
          go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
      - name: Generate protobuf language bindings
        run: |
          make all
      - name: Build all sources
        run: |
          go build ./...
      - name: Run all tests
        run: |
          go test ./...

  run-bazel-tests:
    runs-on: ubuntu-latest
    steps:
      - name: Check out sources
        uses: actions/checkout@v2
      - name: Set up Bazel environment
        uses: bazelbuild/setup-bazelisk@v1
      - name: Mount Bazel cache
        uses: actions/cache@v2
        with:
          path: "~/.cache/bazel"
          key: bazel
      - name: Build all sources
        run: |
          bazel build //...
      - name: Run all tests
        run: |
          bazel test --test_output=errors //...

Add GitHub Actions to run tests
Add GitHub Actions to run tests

These actions test STET with both "go test" and "bazel test".

PiperOrigin-RevId: 398557411
Change-Id: Ice1d50d3a96c299eb072ae085cba820e289acac9
