name: macOs build

on:
  push:
    branches: [ master, develop, 1.0.* ]
    tags: 1.0.*
    
  pull_request:
    branches: [ master, develop, 1.0.* ]

jobs:
  build:
    runs-on: macos-latest

    strategy:
      matrix:
        qt: ['6.2.4', '6.3.1', '6.4.1']

    steps:
    - uses: actions/checkout@v2
      
    - name: Installing Qt framework
      uses: jurplel/install-qt-action@v2
      with:
        version: ${{ matrix.qt }}

    - name: Running qmake
      run:  cd $GITHUB_WORKSPACE; qmake pgmodeler.pro -r PREFIX=/Applications/pgModeler.app/Contents PGSQL_INC=`pg_config --includedir` PGSQL_LIB=`pg_config --libdir`/libpq.dylib CONFIG+=debug
    
    - name: Building pgModeler
      run: make -j6
     
    - name: Deploying pgModeler
      run: make install
