3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-06-27 02:58:48 +00:00

Add ccache

This commit is contained in:
Miodrag Milanovic 2026-06-26 08:02:58 +02:00
parent 06a64af1f4
commit 63dd0e1a60
4 changed files with 44 additions and 13 deletions

View file

@ -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:

View file

@ -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

View file

@ -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:

View file

@ -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