name: Continous Integration

on:
  push:
    branches:
      - 'master'
      - 'main'
  pull_request:
    branches:
    - 'master'
    - 'main'

defaults:
  run:
    shell: bash

env:
  SOURCE_DIR:   ${{ github.workspace }}
  QT_VERSION:   6.5.2

jobs:
  build:
    runs-on:  ubuntu-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v4

      - name: Install Qt
        uses: jurplel/install-qt-action@v3
        with:
          version:      ${{ env.QT_VERSION }}
          host:         linux
          target:       desktop
          # arch:         gcc_64
          dir:          ${{ runner.temp }}
          setup-python: false
              
      - name: Create build directory
        run:  mkdir ${{ env.SOURCE_DIR }}/build

      - name: Build
        working-directory: ${{ env.SOURCE_DIR }}
        run:  |
              ./build.sh --clean         
