diff --git a/.github/workflows/CI-unixish-docker.yml b/.github/workflows/CI-unixish-docker.yml index 708d2e457e3..9a287441951 100644 --- a/.github/workflows/CI-unixish-docker.yml +++ b/.github/workflows/CI-unixish-docker.yml @@ -78,6 +78,8 @@ jobs: if: matrix.image == 'centos:7' run: | yum install -y gcc-c++ make which python3 pcre-devel + yum --enablerepo=extras install -y epel-release + yum install -y ccache - name: Install missing software on ubuntu if: matrix.image != 'centos:7' @@ -85,12 +87,25 @@ jobs: apt-get update apt-get install -y g++ make python3 libxml2-utils libpcre3-dev + # needs to be called after the package installation since + # - it doesn't call "apt-get update" + # - it doesn't support centos + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + if: matrix.image != 'ubuntu:14.04' # no support for --set-config + with: + key: ${{ github.workflow }}-${{ matrix.image }} + - name: Build cppcheck run: | + # "/usr/lib64" for centos / "/usr/lib" for ubuntu + export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) HAVE_RULES=yes - name: Build test run: | + # "/usr/lib64" for centos / "/usr/lib" for ubuntu + export PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) testrunner HAVE_RULES=yes - name: Run test diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index 5ae25cc7465..6d51a28980c 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -107,6 +107,12 @@ jobs: steps: - uses: actions/checkout@v2 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + if: contains(matrix.os, 'ubuntu') + with: + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # coreutils contains "nproc" - name: Install missing software on macos if: contains(matrix.os, 'macos') @@ -115,6 +121,7 @@ jobs: - name: Build with Unsigned char run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) CXXFLAGS=-funsigned-char testrunner - name: Test with Unsigned char @@ -133,6 +140,12 @@ jobs: steps: - uses: actions/checkout@v2 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + if: contains(matrix.os, 'ubuntu') + with: + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + # coreutils contains "nproc" - name: Install missing software on macos if: contains(matrix.os, 'macos') @@ -141,6 +154,7 @@ jobs: - name: Build with TEST_MATHLIB_VALUE run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) CPPFLAGS=-DTEST_MATHLIB_VALUE all - name: Test with TEST_MATHLIB_VALUE @@ -194,9 +208,16 @@ jobs: run: | brew install coreutils qt@5 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + if: contains(matrix.os, 'ubuntu') + with: + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + - name: Build GUI on ubuntu if: contains(matrix.os, 'ubuntu') run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" pushd gui qmake CONFIG+=debug HAVE_QCHART=yes make -j$(nproc) @@ -204,6 +225,7 @@ jobs: - name: Run GUI tests on ubuntu if: contains(matrix.os, 'ubuntu') run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" pushd gui/test/cppchecklibrarydata qmake CONFIG+=debug make -j$(nproc) @@ -241,6 +263,7 @@ jobs: - name: Build triage on ubuntu if: contains(matrix.os, 'ubuntu') run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" pushd tools/triage qmake CONFIG+=debug make -j$(nproc) @@ -275,6 +298,12 @@ jobs: steps: - uses: actions/checkout@v2 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + if: contains(matrix.os, 'ubuntu') + with: + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + - name: Install missing software on ubuntu if: contains(matrix.os, 'ubuntu') run: | @@ -300,10 +329,12 @@ jobs: - name: Build cppcheck run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) HAVE_RULES=yes - name: Build test run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) testrunner HAVE_RULES=yes - name: Run test @@ -395,6 +426,11 @@ jobs: steps: - uses: actions/checkout@v2 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }} + - name: Install missing software on ubuntu run: | sudo apt-get update @@ -402,6 +438,7 @@ jobs: - name: Self check (build) run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" # compile with verification and ast matchers make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2" MATCHCOMPILER=yes VERIFY=1 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 922a3a86dff..2d8b606b010 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@v2 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ github.workflow }}-${{ runner.os }} + - name: Install missing software on ubuntu run: | sudo apt-get update @@ -26,6 +31,7 @@ jobs: - name: Compile instrumented run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" make -j$(nproc) test CXXFLAGS="-g -fprofile-arcs -ftest-coverage" HAVE_RULES=yes - name: Generate coverage report diff --git a/.github/workflows/scriptcheck.yml b/.github/workflows/scriptcheck.yml index a1f99da3b86..7ec4df3e4b8 100644 --- a/.github/workflows/scriptcheck.yml +++ b/.github/workflows/scriptcheck.yml @@ -19,7 +19,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: - key: scriptcheck-${{ runner.os }} + key: ${{ github.workflow }}-${{ runner.os }} - name: Cache Cppcheck uses: actions/cache@v2 diff --git a/.github/workflows/selfcheck.yml b/.github/workflows/selfcheck.yml index fdd0a6bc9f2..6a949c07ac8 100644 --- a/.github/workflows/selfcheck.yml +++ b/.github/workflows/selfcheck.yml @@ -21,7 +21,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: - key: selfcheck-${{ runner.os }} + key: ${{ github.workflow }}-${{ runner.os }} - name: Cache Qt ${{ env.QT_VERSION }} id: cache-qt diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 62c9f73b949..f0c1b3c175d 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -15,7 +15,12 @@ jobs: steps: - uses: actions/checkout@v2 - + + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ github.workflow }}-${{ runner.os }} + - name: Prepare run: | sudo apt-get update @@ -38,10 +43,12 @@ jobs: - name: Build cppcheck run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" CXXFLAGS="-O1 -g" make -j$(nproc) HAVE_RULES=yes MATCHCOMPILER=yes - name: Build test run: | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" CXXFLAGS="-O1 -g" make -j$(nproc) testrunner HAVE_RULES=yes MATCHCOMPILER=yes - name: Run valgrind