From 9d56817ad8736a1ac3beb028682d1616e357c568 Mon Sep 17 00:00:00 2001 From: MinyazevR Date: Fri, 16 Aug 2024 14:05:38 +0300 Subject: [PATCH] Add ccache to CI --- .github/workflows/build.yml | 14 ++++++++++++-- .github/workflows/build_latest.yml | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a7e99f15..7cf2c27ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,13 +54,18 @@ jobs: - name: Checkout PythonQt uses: actions/checkout@v4 + - name: Ccache + uses: hendrikmuhs/ccache-action@v1.2.14 + with: + key: ${{ runner.os }}-ubuntu-${{ matrix.container_version }} + - name: Build PythonQt run: | export QT_SELECT=qt5 echo ======= SYSTEM INFO ======== uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version echo ============================ - qmake -r PythonQt.pro CONFIG+=release CONFIG+=force_debug_info \ + qmake -r PythonQt.pro CONFIG+=ccache 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) @@ -202,6 +207,11 @@ jobs: - name: Checkout PythonQt uses: actions/checkout@v4 + - name: Ccache + uses: hendrikmuhs/ccache-action@v1.2.14 + with: + key: ${{ runner.os }}-${{ matrix.qt-version }} + - name: Detect exact versions id : versions run : | @@ -230,7 +240,7 @@ jobs: for i in "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}-embed" "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" \ "python${PYTHON_VERSION_MAJOR}-embed" "python${PYTHON_VERSION_MAJOR}" do if pkg-config --exists "$i"; then PYTHON_PKGCONFIG_NAME="$i"; break; fi; done - qmake CONFIG+=${{ matrix.configuration }} CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ + qmake CONFIG+=ccache CONFIG+=${{ matrix.configuration }} CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \ PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }} \ PYTHON_DIR="$pythonLocation" \ PKGCONFIG+=$PYTHON_PKGCONFIG_NAME \ diff --git a/.github/workflows/build_latest.yml b/.github/workflows/build_latest.yml index e1a05b046..6d82e2117 100644 --- a/.github/workflows/build_latest.yml +++ b/.github/workflows/build_latest.yml @@ -6,6 +6,10 @@ on: - master pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + defaults: run: shell: bash @@ -43,6 +47,12 @@ jobs: - name: Checkout PythonQt uses: actions/checkout@v4 + - name: Ccache + uses: hendrikmuhs/ccache-action@v1.2.14 + with: + key: ${{ runner.os }}-${{ matrix.qt-version }} + if: ${{ matrix.os == 'ubuntu' }} + - name: Set environment id: setenv run: | @@ -60,7 +70,7 @@ jobs: if: ${{ matrix.os == 'ubuntu' }} run: | cd generator - qmake -r generator.pro CONFIG+=release CONFIG-=debug_and_release CONFIG+=force_debug_info \ + qmake -r generator.pro CONFIG+=ccache CONFIG+=release CONFIG-=debug_and_release CONFIG+=force_debug_info \ CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address make -j $(nproc) @@ -93,7 +103,7 @@ jobs: echo ======= SYSTEM INFO ======== uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version echo ============================ - qmake -r PythonQt.pro CONFIG+=release CONFIG+=force_debug_info \ + qmake -r PythonQt.pro CONFIG+=ccache 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)