name: Unittests

on: push

jobs:
  pytest-job:
    runs-on: ubuntu-latest
    timeout-minutes: 30

    steps:
    - uses: styfle/cancel-workflow-action@0.9.1
      with:
        access_token: ${{ github.token }}

    - uses: actions/checkout@v2

    # Install deps
    - uses: actions/setup-python@v2
      with:
        python-version: 3.7
    - run: pip install -e .[dev]
    # Tensorflow has to be installed separately (to allow tf-nightly)
    - run: pip install tensorflow

    # Run tests
    # As pytest globally collect tests, we run datasets test in another process
    # so the datasets are not auto-registered on import.
    - name: Run core tests
      run: pytest -vv -n auto --ignore sunds/datasets/

    - name: Run datasets tests
      run: pytest -vv -n auto sunds/datasets/

name: Unittests

# Allow to trigger the workflow manually (e.g. when pushing changes to `etils`)
on: [push, workflow_dispatch]

jobs:
  pytest-job:
    runs-on: ubuntu-latest
    timeout-minutes: 30

    steps:
    - uses: styfle/cancel-workflow-action@0.9.1
      with:
        access_token: ${{ github.token }}

    - uses: actions/checkout@v2

    # Install deps
    - uses: actions/setup-python@v2
      with:
        python-version: 3.7
    - run: pip install -e .[dev]
    # Tensorflow has to be installed separately (to allow tf-nightly)
    - run: pip install tensorflow

    # Run tests
    # As pytest globally collect tests, we run datasets test in another process
    # so the datasets are not auto-registered on import.
    - name: Run core tests
      run: pytest -vv -n auto --ignore sunds/datasets/

    - name: Run datasets tests
      run: pytest -vv -n auto sunds/datasets/

Allow to manually trigger the tests
Allow to manually trigger the tests

PiperOrigin-RevId: 417814065
