name: 'Validate bazel 9 readiness'
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: Test whether package can build
    working-directory: base/cvd
    env:
      OVERRIDE_BAZEL_VERSION: 9.0.0
    run: |
      bazel build --nobuild //cuttlefish/package:cvd
    shell: bash
