diff --git a/.github/workflows/pull-request-checks.yaml b/.github/workflows/pull-request-checks.yaml index 9d3b09205bc..c54b717a3c9 100644 --- a/.github/workflows/pull-request-checks.yaml +++ b/.github/workflows/pull-request-checks.yaml @@ -16,14 +16,30 @@ jobs: # user input DEBIAN_FRONTEND: noninteractive run: | - sudo apt-get install -yq gcc gdb g++ maven jq flex bison libxml2-utils + sudo apt-get install -yq gcc gdb g++ maven jq flex bison libxml2-utils ccache make -C src minisat2-download + - name: Prepare ccache + uses: actions/cache@v2 + with: + path: .ccache + key: ${{ runner.os }}-20.04-make-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-20.04-make-${{ github.ref }} + ${{ runner.os }}-20.04-make + - name: ccache environment + run: | + echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV + echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV + - name: Zero ccache stats and limit in size + run: ccache -z --max-size=500M - name: Build with make run: | - make -C src CXX='/usr/bin/g++' -j2 - make -C unit CXX='/usr/bin/g++' -j2 - make -C jbmc/src CXX='/usr/bin/g++' -j2 - make -C jbmc/unit CXX='/usr/bin/g++' -j2 + make -C src CXX='ccache /usr/bin/g++' -j2 + make -C unit CXX='ccache /usr/bin/g++' -j2 + make -C jbmc/src CXX='ccache /usr/bin/g++' -j2 + make -C jbmc/unit CXX='ccache /usr/bin/g++' -j2 + - name: Print ccache stats + run: ccache -s - name: Run unit tests run: | make -C unit test @@ -50,14 +66,30 @@ jobs: # user input DEBIAN_FRONTEND: noninteractive run: | - sudo apt-get install -yq cmake ninja-build gcc g++ maven flex bison libxml2-utils dpkg-dev + sudo apt-get install -yq cmake ninja-build gcc g++ maven flex bison libxml2-utils dpkg-dev ccache + - name: Prepare ccache + uses: actions/cache@v2 + with: + path: .ccache + key: ${{ runner.os }}-20.04-Release-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-20.04-Release-${{ github.ref }} + ${{ runner.os }}-20.04-Release + - name: ccache environment + run: | + echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV + echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV - name: Configure using CMake run: | mkdir build cd build cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ + - name: Zero ccache stats and limit in size + run: ccache -z --max-size=500M - name: Build with Ninja run: cd build; ninja -j2 + - name: Print ccache stats + run: ccache -s - name: Check if package building works run: | cd build @@ -73,14 +105,30 @@ jobs: with: submodules: true - name: Fetch dependencies - run: brew install maven flex bison parallel + run: brew install maven flex bison parallel ccache + - name: Prepare ccache + uses: actions/cache@v2 + with: + path: .ccache + key: ${{ runner.os }}-make-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-make-${{ github.ref }} + ${{ runner.os }}-make + - name: ccache environment + run: | + echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV + echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV + - name: Zero ccache stats and limit in size + run: ccache -z --max-size=500M - name: Build using Make run: | make -C src minisat2-download - make -C src -j2 - make -C jbmc/src -j2 - make -C unit - make -C jbmc/unit + make -C src -j2 CXX="ccache clang++" + make -C jbmc/src -j2 CXX="ccache clang++" + make -C unit "CXX=ccache clang++" + make -C jbmc/unit "CXX=ccache clang++" + - name: Print ccache stats + run: ccache -s - name: Run unit tests run: cd unit; ./unit_tests - name: Run JBMC unit tests @@ -97,7 +145,21 @@ jobs: with: submodules: true - name: Fetch dependencies - run: brew install cmake ninja maven flex bison + run: brew install cmake ninja maven flex bison ccache + - name: Prepare ccache + uses: actions/cache@v2 + with: + path: .ccache + key: ${{ runner.os }}-Release-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-Release-${{ github.ref }} + ${{ runner.os }}-Release + - name: ccache environment + run: | + echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV + echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV + - name: Zero ccache stats and limit in size + run: ccache -z --max-size=500M - name: Configure using CMake run: | mkdir build @@ -105,6 +167,8 @@ jobs: cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ - name: Build with Ninja run: cd build; ninja -j2 + - name: Print ccache stats + run: ccache -s - name: Run CTest run: cd build; ctest -V -L CORE . -j2 @@ -187,7 +251,21 @@ jobs: - name: Fetch dependencies run: | choco install winflexbison3 + nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0 + echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH - uses: microsoft/setup-msbuild@v1.0.2 + - name: Prepare ccache + uses: actions/cache@v2 + with: + path: .ccache + key: ${{ runner.os }}-msbuild-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-msbuild-${{ github.ref }} + ${{ runner.os }}-msbuild + - name: ccache environment + run: | + echo "CLCACHE_BASEDIR=$((Get-Item -Path '.\').FullName)" >> $env:GITHUB_ENV + echo "CLCACHE_DIR=$pwd\.ccache" >> $env:GITHUB_ENV - name: Configure with cmake run: | New-Item -ItemType Directory -Path build @@ -196,7 +274,9 @@ jobs: - name: Build Release run: | Set-Location build - cmake --build . --config Release -- /p:CL_MPcount=2 + cmake --build . --config Release -- /p:CL_MPcount=2 /p:CLToolExe=clcache + - name: Print ccache stats + run: clcache -s - name: Create packages id: create_packages # We need to get the path to cpack because fascinatingly, @@ -218,7 +298,21 @@ jobs: with: submodules: recursive - name: Fetch dependencies - run: sudo apt install g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev + run: sudo apt install g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache + - name: Prepare ccache + uses: actions/cache@v2 + with: + path: .ccache + key: ${{ runner.os }}-18.04-Release-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-18.04-Release-${{ github.ref }} + ${{ runner.os }}-18.04-Release + - name: ccache environment + run: | + echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV + echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV + - name: Zero ccache stats and limit in size + run: ccache -z --max-size=500M - name: Configure CMake run: | mkdir build @@ -228,6 +322,8 @@ jobs: run: | cd build ninja -j2 + - name: Print ccache stats + run: ccache -s - name: Run CTest run: cd build; ctest . -V -L CORE -C Release -j2 - name: Create packages diff --git a/.github/workflows/release-packages.yaml b/.github/workflows/release-packages.yaml index fd5d1320db8..eb5ef56bdcd 100644 --- a/.github/workflows/release-packages.yaml +++ b/.github/workflows/release-packages.yaml @@ -13,16 +13,32 @@ jobs: with: submodules: recursive - name: Fetch dependencies - run: sudo apt install g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev + run: sudo apt install g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache + - name: Prepare ccache + uses: actions/cache@v2 + with: + path: .ccache + key: ${{ runner.os }}-20.04-Release-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-20.04-Release-${{ github.ref }} + ${{ runner.os }}-20.04-Release + - name: ccache environment + run: | + echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV + echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV - name: Configure CMake run: | mkdir build cd build cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release + - name: Zero ccache stats and limit in size + run: ccache -z --max-size=500M - name: Build using Ninja run: | cd build ninja -j2 + - name: Print ccache stats + run: ccache -s - name: Run CTest run: cd build; ctest . -V -L CORE -C Release -j2 - name: Create packages @@ -53,16 +69,32 @@ jobs: with: submodules: recursive - name: Fetch dependencies - run: sudo apt install g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev + run: sudo apt install g++ flex bison cmake ninja-build maven jq libxml2-utils dpkg-dev ccache + - name: Prepare ccache + uses: actions/cache@v2 + with: + path: .ccache + key: ${{ runner.os }}-18.04-Release-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-18.04-Release-${{ github.ref }} + ${{ runner.os }}-18.04-Release + - name: ccache environment + run: | + echo "CCACHE_BASEDIR=$PWD" >> $GITHUB_ENV + echo "CCACHE_DIR=$PWD/.ccache" >> $GITHUB_ENV - name: Configure CMake run: | mkdir build cd build cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release + - name: Zero ccache stats and limit in size + run: ccache -z --max-size=500M - name: Build using Ninja run: | cd build ninja -j2 + - name: Print ccache stats + run: ccache -s - name: Run CTest run: cd build; ctest . -V -L CORE -C Release -j2 - name: Create packages @@ -110,12 +142,26 @@ jobs: - name: Fetch dependencies run: | choco install winflexbison3 + nuget install clcache -OutputDirectory "c:\tools" -ExcludeVersion -Version 4.1.0 + echo "c:\tools\clcache\clcache-4.1.0" >> $env:GITHUB_PATH - uses: microsoft/setup-msbuild@v1.0.2 name: Setup Visual Studio environment - name: Setup code sign environment run: | echo "$(Split-Path -Path $(Get-ChildItem -Path ${env:ProgramFiles(x86)} -Recurse -Filter 'signtool.exe' | Where-Object FullName -like '*10.0.19041.0\x64\signtool.exe').FullName)" >> $env:GITHUB_PATH echo "pfxcert=$([string](Get-Location)+'\CodeSignCertificate.pfx')" >> $env:GITHUB_ENV + - name: Prepare ccache + uses: actions/cache@v2 + with: + path: .ccache + key: ${{ runner.os }}-msbuild-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-msbuild-${{ github.ref }} + ${{ runner.os }}-msbuild + - name: ccache environment + run: | + echo "CLCACHE_BASEDIR=$((Get-Item -Path '.\').FullName)" >> $env:GITHUB_ENV + echo "CLCACHE_DIR=$pwd\.ccache" >> $env:GITHUB_ENV - name: Configure with cmake run: | New-Item -ItemType Directory -Path build @@ -124,7 +170,9 @@ jobs: - name: Build Release run: | Set-Location build - cmake --build . --config Release -j2 + cmake --build . --config Release -j2 -- /p:CLToolExe=clcache + - name: Print ccache stats + run: clcache -s - name: Create packages id: create_packages run: |