From 51a90d7164a1643aac04ce026a22aa75d972c7be Mon Sep 17 00:00:00 2001 From: Iakov 'Jake' Kirilenko Date: Sat, 11 Nov 2023 16:03:55 +0300 Subject: [PATCH 1/4] Add CI for the latest Qt5 and Qt6 --- .github/workflows/build.yml | 6 +-- .github/workflows/build_latest.yml | 71 ++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build_latest.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58a8591fe..6856e9a40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \ PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname) - make -j 2 + make -j $(nproc) UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ make check TESTARGS="-platform offscreen" @@ -120,7 +120,7 @@ jobs: qmake-qt5 -r PythonQt.pro CONFIG+=${{ matrix.configuration }} \ PYTHON_VERSION=$(python${PYTHON_VERSION_SUFFIX} --version | cut -d " " -f 2 | cut -d "." -f1,2) \ PYTHON_DIR=$(which python${PYTHON_VERSION_SUFFIX} | xargs dirname | xargs dirname) - make -j 2 && make check TESTARGS="-platform offscreen" + make -j $(nproc) && make check TESTARGS="-platform offscreen" - name: Generate Wrappers run: | @@ -203,7 +203,7 @@ jobs: PYTHON_DIR="$pythonLocation" \ PKGCONFIG+=$PYTHON_PKGCONFIG_NAME \ -r PythonQt.pro - make -j 2 + make -j $(nproc) UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ make check TESTARGS="-platform offscreen" diff --git a/.github/workflows/build_latest.yml b/.github/workflows/build_latest.yml new file mode 100644 index 000000000..cb1595103 --- /dev/null +++ b/.github/workflows/build_latest.yml @@ -0,0 +1,71 @@ +name: Latest Qt5/6 + +on: + push: + branches: + - master + pull_request: + +defaults: + run: + shell: bash + +jobs: + ubuntu: + strategy: + fail-fast: false + matrix: + qt-version: [ '5.*', '6.*'] + python-version: [ '3.12' ] + runs-on: ubuntu-latest + steps: + + - name: Install Qt ${{matrix.qt-version}} + uses: jurplel/install-qt-action@v3 + with: + version: ${{ matrix.qt-version }} + modules: ${{startsWith(matrix.qt-version, '6') && 'qt5compat' || '' }} + archives: 'qtmultimedia qtlinuxextras qtbase qttools icu qtwayland' + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: '${{ matrix.python-version }}' + + - name: Checkout PythonQt + uses: actions/checkout@v3 + + - name: Set environment + run: | + QT_VERSION_MAJOR=$(cut -f 1 -d . <<< "${{matrix.qt-version}}") + echo "QT_VERSION_MAJOR=$QT_VERSION_MAJOR" >> $GITHUB_ENV + QTDIR=$(eval echo "\$Qt${QT_VERSION_MAJOR}_DIR") + echo "QTDIR=$QTDIR" >> $GITHUB_ENV + echo "$QTDIR/bin" >> $GITHUB_PATH + echo "$pythonLocation/bin" >> $GITHUB_PATH + + - name: Build PythonQt + run: | + echo ======= SYSTEM INFO ======== + uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version + echo ============================ + qmake -r PythonQt.pro CONFIG+=release CONFIG+=force_debug_info \ + CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ + PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \ + PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname) + make -j $(nproc) + UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ + make check TESTARGS="-platform offscreen" + + - name: Generate Wrappers + run: | + cd generator + UBSAN_OPTIONS="halt_on_error=1" \ + ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ + ./pythonqt_generator + + - name: Upload Wrappers + uses: actions/upload-artifact@v3 + with: + name: wrappers_ubuntu_${{startsWith(matrix.qt-version, '6') && '6' || '5' }}-latest + path: generated_cpp From 8404137df024f998f4093a28c38e100e6ed0bfc9 Mon Sep 17 00:00:00 2001 From: YuriUfimtsev Date: Fri, 17 Nov 2023 13:17:09 +0300 Subject: [PATCH 2/4] Change qt version --- .github/workflows/build_latest.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_latest.yml b/.github/workflows/build_latest.yml index cb1595103..96e4eed71 100644 --- a/.github/workflows/build_latest.yml +++ b/.github/workflows/build_latest.yml @@ -1,4 +1,4 @@ -name: Latest Qt5/6 +name: Latest Qt5 on: push: @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - qt-version: [ '5.*', '6.*'] + qt-version: [ '5.12.*' ] python-version: [ '3.12' ] runs-on: ubuntu-latest steps: @@ -24,7 +24,6 @@ jobs: uses: jurplel/install-qt-action@v3 with: version: ${{ matrix.qt-version }} - modules: ${{startsWith(matrix.qt-version, '6') && 'qt5compat' || '' }} archives: 'qtmultimedia qtlinuxextras qtbase qttools icu qtwayland' - name: Setup Python ${{ matrix.python-version }} @@ -67,5 +66,5 @@ jobs: - name: Upload Wrappers uses: actions/upload-artifact@v3 with: - name: wrappers_ubuntu_${{startsWith(matrix.qt-version, '6') && '6' || '5' }}-latest + name: wrappers_ubuntu_5-latest path: generated_cpp From 9a8f44af0e3845f6f7502ee1b79da5659861e195 Mon Sep 17 00:00:00 2001 From: YuriUfimtsev Date: Fri, 17 Nov 2023 13:18:59 +0300 Subject: [PATCH 3/4] Add the generator build step --- .github/workflows/build_latest.yml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_latest.yml b/.github/workflows/build_latest.yml index 96e4eed71..b1462ac8d 100644 --- a/.github/workflows/build_latest.yml +++ b/.github/workflows/build_latest.yml @@ -43,19 +43,13 @@ jobs: echo "$QTDIR/bin" >> $GITHUB_PATH echo "$pythonLocation/bin" >> $GITHUB_PATH - - name: Build PythonQt + - name: Build generator run: | - echo ======= SYSTEM INFO ======== - uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version - echo ============================ - qmake -r PythonQt.pro CONFIG+=release CONFIG+=force_debug_info \ - CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ - PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \ - PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname) + cd generator + qmake -r generator.pro CONFIG+=release CONFIG+=force_debug_info \ + CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address make -j $(nproc) - UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ - make check TESTARGS="-platform offscreen" - + - name: Generate Wrappers run: | cd generator @@ -68,3 +62,16 @@ jobs: with: name: wrappers_ubuntu_5-latest path: generated_cpp + + - name: Build PythonQt + run: | + echo ======= SYSTEM INFO ======== + uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version + echo ============================ + qmake -r PythonQt.pro CONFIG+=release CONFIG+=force_debug_info \ + CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ + PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \ + PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname) + make -j $(nproc) + UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \ + make check TESTARGS="-platform offscreen" From d9520ce2fca00cbc6efafb0f3fdadeca05fbe298 Mon Sep 17 00:00:00 2001 From: YuriUfimtsev Date: Fri, 17 Nov 2023 20:45:33 +0300 Subject: [PATCH 4/4] Rename workflow and add qt5.15 to the matrix --- .github/workflows/build_latest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_latest.yml b/.github/workflows/build_latest.yml index b1462ac8d..e58beb8a0 100644 --- a/.github/workflows/build_latest.yml +++ b/.github/workflows/build_latest.yml @@ -1,4 +1,4 @@ -name: Latest Qt5 +name: Qt5 check generated_cpp on: push: @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - qt-version: [ '5.12.*' ] + qt-version: [ '5.12.*', '5.15.*' ] python-version: [ '3.12' ] runs-on: ubuntu-latest steps: