name: BVT
on: [pull_request]
jobs:
  bvt:
    name: BVT
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: install dependencies
      run: |
        rustup target add x86_64-unknown-linux-musl
        rustup component add rustfmt clippy
    - name: Format Check
      run: make fmt
    - name: Clippy Check
      run: make clippy
    - name: Build
      run: make vsock
    - name: Build echo_server
      run: make echo_server

    ## Unfortunately GitHub Acions doesn't support nested virtualization at the moment,
    ## And the vsock have bugs on qemu + tcg, so we can't run the unit test for now.
    # - name: Install QEMU
    #   run: |
    #     sudo apt-get install qemu-system-x86 -y
    #     sudo modprobe vhost_vsock
    # - name: Run Unit Test
    #   run: |
    #     make vm-for-action
    #     make check
