name: CI

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Mount bazel cache
        uses: actions/cache@v1
        with:
          path: "/home/runner/.cache/bazel"
          key: bazel

      - name: Install bazelisk
        run: |
          curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64"
          mkdir -p "${GITHUB_WORKSPACE}/bin/"
          mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
          chmod +x "${GITHUB_WORKSPACE}/bin/bazel"

      - name: Setup protobuf specification file
        run: |
          mv protocol_buffer/document_test.proto protocol_buffer/document.proto

      - name: Run tests
        run: |
          "${GITHUB_WORKSPACE}/bin/bazel" test --test_output=errors --test_verbose_timeout_warnings //...

      - name: Build
        run: |
          "${GITHUB_WORKSPACE}/bin/bazel" build //...

  lint:
    runs-on: ubuntu-latest
    
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Setup Python
      uses: actions/setup-python@v1

    - name: Install cpplint
      run: pip install cpplint

    - name: Run cpplint
      run: cpplint --recursive .

    - name: Install pylint
      run: pip install pylint

    - name: Run pylint
      run: pylint training/

name: CI

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Mount bazel cache
        uses: actions/cache@v1
        with:
          path: "/home/runner/.cache/bazel"
          key: bazel

      - name: Install bazelisk
        run: |
          curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.1.0/bazelisk-linux-amd64"
          mkdir -p "${GITHUB_WORKSPACE}/bin/"
          mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
          chmod +x "${GITHUB_WORKSPACE}/bin/bazel"

      - name: Setup protobuf specification file
        run: |
          mv protocol_buffer/document_test.proto protocol_buffer/document.proto

      - name: Run tests
        run: |
          "${GITHUB_WORKSPACE}/bin/bazel" test --test_output=errors --test_verbose_timeout_warnings //...

      - name: Build
        run: |
          "${GITHUB_WORKSPACE}/bin/bazel" build //...

  lint:
    runs-on: ubuntu-latest
    
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Setup Python
      uses: actions/setup-python@v1

    - name: Install cpplint
      run: pip install cpplint

    - name: Run cpplint
      run: cpplint --recursive .

    - name: Install pylint
      run: pip install pylint

    - name: Run pylint
      run: pylint *

Apply pylint on all python files
Apply pylint on all python files
