diff --git a/.github/workflows/extra-builds.yml b/.github/workflows/extra-builds.yml index 603d91e5d..788e12c29 100644 --- a/.github/workflows/extra-builds.yml +++ b/.github/workflows/extra-builds.yml @@ -45,6 +45,11 @@ jobs: - name: Setup MSVC uses: ilammy/msvc-dev-cmd@v1 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.23 + with: + key: vs-build + - name: Install flex/bison shell: pwsh run: | @@ -57,8 +62,9 @@ jobs: - name: Configure CMake run: > cmake -S . -B build - -A x64 + -G Ninja -DCMAKE_BUILD_TYPE=Release + -DYOSYS_COMPILER_LAUNCHER=ccache - name: Build run: > @@ -85,6 +91,11 @@ jobs: install: >- base-devel + bison + flex + gawk + diffutils + make mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-gtest @@ -93,13 +104,12 @@ jobs: mingw-w64-x86_64-tcl mingw-w64-x86_64-libffi mingw-w64-x86_64-git + mingw-w64-x86_64-ccache - msys2-install: >- - bison - flex - gawk - diffutils - make + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.23 + with: + key: mingw-build - name: Build Yosys shell: msys2 {0} @@ -107,7 +117,7 @@ jobs: set -e procs=$(nproc) rm -rf build - cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DYOSYS_COMPILER_LAUNCHER=ccache cmake --build build -j${procs} ctest --test-dir build/tests/unit --output-on-failure @@ -121,6 +131,11 @@ jobs: with: submodules: true persist-credentials: false + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.23 + with: + key: wasi-build + - name: Build run: | WASI_VER=33 @@ -140,7 +155,7 @@ jobs: make install) export PATH=${WASI_SDK_PATH}/bin:$(pwd)/flex-prefix/bin:${PATH} - cmake -B build -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK_PATH}/share/cmake/wasi-sdk-p1.cmake -DCMAKE_BUILD_TYPE=Release . + cmake -B build -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK_PATH}/share/cmake/wasi-sdk-p1.cmake -DCMAKE_BUILD_TYPE=Release -DYOSYS_COMPILER_LAUNCHER=ccache . cmake --build build -j$(nproc) nix-build: diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index e09fd9eb3..6edf4fb25 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -79,11 +79,16 @@ jobs: runs-on: ${{ matrix.os }} get-build-deps: true + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.23 + with: + key: test-build-${{ matrix.os }} + - name: Build shell: bash run: | rm -rf build - cmake -B build . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release + cmake -B build . -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DYOSYS_COMPILER_LAUNCHER=ccache cmake --build build -j$procs ctest --test-dir build/tests/unit diff --git a/.github/workflows/test-compile.yml b/.github/workflows/test-compile.yml index 3093e8dfd..87798c3a1 100644 --- a/.github/workflows/test-compile.yml +++ b/.github/workflows/test-compile.yml @@ -69,6 +69,11 @@ jobs: runs-on: ${{ matrix.os }} get-build-deps: true + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.23 + with: + key: test-compile-${{ matrix.os }}-${{ matrix.compiler }} + - name: Setup Cpp uses: aminya/setup-cpp@v1 with: @@ -91,7 +96,7 @@ jobs: shell: bash run: | rm -rf build - cmake -B build -DCMAKE_CXX_STANDARD=20 . --fresh + cmake -B build -DCMAKE_CXX_STANDARD=20 -DYOSYS_COMPILER_LAUNCHER=ccache . --fresh cmake --build build --target yosys -j$procs # maximum standard, only on newest compilers @@ -100,7 +105,7 @@ jobs: shell: bash run: | rm -rf build - cmake -B build -DCMAKE_CXX_STANDARD=26 . --fresh + cmake -B build -DCMAKE_CXX_STANDARD=26 -DYOSYS_COMPILER_LAUNCHER=ccache . --fresh cmake --build build --target yosys -j$procs test-compile-result: diff --git a/.github/workflows/test-sanitizers.yml b/.github/workflows/test-sanitizers.yml index d6c77fcf1..94ef62f04 100644 --- a/.github/workflows/test-sanitizers.yml +++ b/.github/workflows/test-sanitizers.yml @@ -60,13 +60,19 @@ jobs: get-test-deps: true get-iverilog: true + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2.23 + with: + key: test-san-${{ matrix.os }} + - name: Build shell: bash run: | rm -rf build cmake -B build . \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ - -DCMAKE_BUILD_TYPE=Sanitize -DSANITIZE=${{ matrix.sanitizer }} + -DCMAKE_BUILD_TYPE=Sanitize -DSANITIZE=${{ matrix.sanitizer }} \ + -DYOSYS_COMPILER_LAUNCHER=ccache cmake --build build -j$procs - name: Log yosys-config output