diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2be33cf..70a483d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,15 +36,16 @@ jobs: fi - uses: actions/cache@v6 with: - key: build-cache-v2-${{ matrix.platform }}-${{ hashFiles('build.sh', 'setup.sh', '*/pyproject.toml', '*/setup.py', '*/build.sh') }} - restore-keys: build-cache-v2-${{ matrix.platform }}- + key: ccache-${{ matrix.platform }}-${{ github.run_id }} + restore-keys: ccache-${{ matrix.platform }}- + path: .ccache + - uses: actions/cache@v6 + with: + key: downloads-${{ matrix.platform }}-${{ hashFiles('gcc-arm-none-eabi/build.sh', 'git-lfs/build.sh') }} path: | .uv-cache - */*/install */*/toolchain */*/bin - */*-src - */build - name: Build wheels env: MANYLINUX: ${{ runner.os == 'Linux' && '1' || '0' }} diff --git a/.gitignore b/.gitignore index 6d0cd60..0b980f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .git/ repo/ .venv/ +.ccache/ __pycache__/ uv.lock diff --git a/build.sh b/build.sh index fe03a50..a0c2f8f 100755 --- a/build.sh +++ b/build.sh @@ -24,6 +24,7 @@ if [[ "$USE_MANYLINUX" == "1" && -z "${BUILD_SH_IN_MANYLINUX:-}" ]]; then -e BUILD_SH_HOST_GID="$(id -g)" \ -e HOME=/tmp \ -e UV_CACHE_DIR=/work/.uv-cache \ + -e CCACHE_DIR=/work/.ccache \ -e UV_PYTHON=/opt/python/cp312-cp312/bin/python3 \ -v "$ROOT_DIR:/work" \ -v "$UV_BIN:/usr/local/bin/uv:ro" \ @@ -61,6 +62,7 @@ fi export CMAKE_C_COMPILER_LAUNCHER=ccache export CMAKE_CXX_COMPILER_LAUNCHER=ccache +export CCACHE_DIR="${CCACHE_DIR:-$ROOT_DIR/.ccache}" restore_build_versions() { python3 build_versions.py restore */pyproject.toml diff --git a/cppcheck/build.sh b/cppcheck/build.sh index 329f476..4fbee9c 100755 --- a/cppcheck/build.sh +++ b/cppcheck/build.sh @@ -8,7 +8,7 @@ VERSION="2.21.0" INSTALL_DIR="$DIR/cppcheck/install" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" -CXX="ccache ${CXX:-c++}" +export CXX="ccache ${CXX:-c++}" # Clone/update source if [ ! -d "cppcheck-src/.git" ]; then diff --git a/ffmpeg/build.sh b/ffmpeg/build.sh index 7c3f9c2..30c76cd 100755 --- a/ffmpeg/build.sh +++ b/ffmpeg/build.sh @@ -13,7 +13,7 @@ LIBVA_VERSION="2.22.0" INSTALL_DIR="$DIR/ffmpeg/install" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" -CC="ccache ${CC:-cc}" +export CC="ccache ${CC:-cc}" PREFIX="$DIR/build/prefix" mkdir -p "$DIR/build" rm -rf "$PREFIX"