name: bazel-ci

on:
  [push, pull_request]

jobs:
  compile:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: '3.9'
      - name: Install dependencies
        run: |
          python3 -m pip install --upgrade pip
          python3 -m pip install -r requirements_dev.txt
      - name: bazel install
        run: |
          wget https://github.com/bazelbuild/bazel/releases/download/3.7.0/bazel_3.7.0-linux-x86_64.deb
          echo "2fc8dfb85328112a9d67f614e33026be74c2ac95645ed8e88896366eaa3d8fc3 bazel_3.7.0-linux-x86_64.deb" | sha256sum --check
          sudo dpkg -i bazel_3.7.0-linux-x86_64.deb
      - run: pip install numpy
      - name: bazel build
        run: /usr/bin/bazel --bazelrc=.bazelrc.travis build //...
      - name: bazel test
        run: /usr/bin/bazel --bazelrc=.bazelrc.travis test --test_output=errors //...
