name: Build

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  Tests:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v1

      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y libusb-1.0-0-dev qt6-tools-dev qt6-base-dev
          qtchooser -install qt6 $(which qmake6)

      - name: Build Tests
        run: |
          cd Software/PC_Application/LibreVNA-Test
          export QT_SELECT=qt6
          qmake LibreVNA-Test.pro
          make -j9
        shell: bash
        
      - name: Run Tests
        run: |
          cd Software/PC_Application/LibreVNA-Test
          ./LibreVNA-Test -platform offscreen

