name: 'Run cvd unit tests'
runs:
  using: "composite"
  steps:
  - name: Setup apt
    run: |
      sudo apt-get purge firefox
      sudo apt-get update -y && sudo apt-get upgrade -y
    shell: bash
  - name: Install dependencies
    run: |
      sudo apt-get install -y git clang libcurl4-openssl-dev clang-tidy xxd cmake liblzma-dev libvpx-dev libopus-dev libaom-dev autoconf libtool
      wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2_amd64.deb
      sudo dpkg -i libtinfo5_6.3-2_amd64.deb
    shell: bash
  - name: Install bazel
    run: sudo tools/buildutils/installbazel.sh
    shell: bash
  - name: Run unit tests
    run: cd base/cvd && bazel test --disk_cache=$HOME/bazel-disk-cache --sandbox_writable_path=$HOME --test_output=errors ...
    shell: bash
