diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 5d1e0fcf9..10cfb5669 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -22,6 +22,16 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Cache FetchContent deps + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/.fc-cache + !${{ github.workspace }}/.fc-cache/*-build + !${{ github.workspace }}/.fc-cache/*-build/** + key: fc-v2-ios-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: | + fc-v2-ios- - name: Select Xcode ${{ inputs.xcode-version }} run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer @@ -29,6 +39,8 @@ jobs: - name: Generate iOS solution run: | cmake -G Xcode -B build/iOS \ + -D FETCHCONTENT_BASE_DIR=${{ github.workspace }}/.fc-cache \ + -D FETCHCONTENT_UPDATES_DISCONNECTED=ON \ -D IOS=ON \ -D DEPLOYMENT_TARGET=${{ inputs.deployment-target }} \ -D BABYLON_DEBUG_TRACE=ON \ diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 4a9eaff07..bcef37508 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -31,6 +31,16 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Cache FetchContent deps + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/.fc-cache + !${{ github.workspace }}/.fc-cache/*-build + !${{ github.workspace }}/.fc-cache/*-build/** + key: fc-v2-linux-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: | + fc-v2-linux- - name: Install packages run: | @@ -40,6 +50,8 @@ jobs: - name: Build X11 run: | cmake -G Ninja -B build/Linux \ + -D FETCHCONTENT_BASE_DIR=${{ github.workspace }}/.fc-cache \ + -D FETCHCONTENT_UPDATES_DISCONNECTED=ON \ -D JAVASCRIPTCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so \ -D NAPI_JAVASCRIPT_ENGINE=${{ inputs.js-engine }} \ -D CMAKE_BUILD_TYPE=RelWithDebInfo \ diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index b60bfc970..c2e311d52 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -31,6 +31,16 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Cache FetchContent deps + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/.fc-cache + !${{ github.workspace }}/.fc-cache/*-build + !${{ github.workspace }}/.fc-cache/*-build/** + key: fc-v2-macos-${{ inputs.generator }}-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: | + fc-v2-macos-${{ inputs.generator }}- - name: Select Xcode ${{ inputs.xcode-version }} run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer @@ -38,6 +48,8 @@ jobs: - name: Generate macOS solution run: | cmake -G "${{ inputs.generator }}" -B build/macOS \ + -D FETCHCONTENT_BASE_DIR=${{ github.workspace }}/.fc-cache \ + -D FETCHCONTENT_UPDATES_DISCONNECTED=ON \ -D BABYLON_DEBUG_TRACE=ON \ -D ENABLE_SANITIZERS=${{ inputs.enable-sanitizers && 'ON' || 'OFF' }} \ -D BABYLON_NATIVE_TESTS_USE_NOOP_METAL_DEVICE=ON diff --git a/.github/workflows/build-uwp.yml b/.github/workflows/build-uwp.yml index 12ccc68d5..aa3c3481b 100644 --- a/.github/workflows/build-uwp.yml +++ b/.github/workflows/build-uwp.yml @@ -18,6 +18,16 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Cache FetchContent deps + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/.fc-cache + !${{ github.workspace }}/.fc-cache/*-build + !${{ github.workspace }}/.fc-cache/*-build/** + key: fc-v2-uwp-${{ inputs.platform }}-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: | + fc-v2-uwp-${{ inputs.platform }}- - name: Set NAPI variables id: napi @@ -36,6 +46,8 @@ jobs: run: | cmake -G "Visual Studio 17 2022" ^ -B build/UWP_${{ inputs.platform }}${{ steps.napi.outputs.suffix }} ^ + -D FETCHCONTENT_BASE_DIR=${{ github.workspace }}/.fc-cache ^ + -D FETCHCONTENT_UPDATES_DISCONNECTED=ON ^ -D CMAKE_SYSTEM_NAME=WindowsStore ^ -D CMAKE_SYSTEM_VERSION=10.0 ^ ${{ steps.napi.outputs.define }} ^ diff --git a/.github/workflows/build-win32-shader.yml b/.github/workflows/build-win32-shader.yml index 3b83ddee7..3f8e24356 100644 --- a/.github/workflows/build-win32-shader.yml +++ b/.github/workflows/build-win32-shader.yml @@ -15,6 +15,16 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Cache FetchContent deps + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/.fc-cache + !${{ github.workspace }}/.fc-cache/*-build + !${{ github.workspace }}/.fc-cache/*-build/** + key: fc-v2-win32shader-${{ inputs.platform }}-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: | + fc-v2-win32shader-${{ inputs.platform }}- - name: Generate solution shell: cmd @@ -22,6 +32,8 @@ jobs: cmake -G "Visual Studio 17 2022" ^ -B build/Win32_${{ inputs.platform }}_PrecompiledShaderTest ^ -A ${{ inputs.platform }} ^ + -D FETCHCONTENT_BASE_DIR=${{ github.workspace }}/.fc-cache ^ + -D FETCHCONTENT_UPDATES_DISCONNECTED=ON ^ -D BX_CONFIG_DEBUG=ON ^ -D GRAPHICS_API=D3D11 ^ -D BGFX_CONFIG_MAX_FRAME_BUFFERS=256 ^ diff --git a/.github/workflows/build-win32.yml b/.github/workflows/build-win32.yml index d0ec9f573..64d9145fd 100644 --- a/.github/workflows/build-win32.yml +++ b/.github/workflows/build-win32.yml @@ -26,6 +26,16 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Cache FetchContent deps + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/.fc-cache + !${{ github.workspace }}/.fc-cache/*-build + !${{ github.workspace }}/.fc-cache/*-build/** + key: fc-v2-win32-${{ inputs.platform }}-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: | + fc-v2-win32-${{ inputs.platform }}- - name: Set variables id: vars @@ -51,6 +61,8 @@ jobs: cmake -G "Visual Studio 17 2022" ^ -B build/${{ steps.vars.outputs.solution_name }} ^ -A ${{ inputs.platform }} ^ + -D FETCHCONTENT_BASE_DIR=${{ github.workspace }}/.fc-cache ^ + -D FETCHCONTENT_UPDATES_DISCONNECTED=ON ^ ${{ steps.vars.outputs.js_define }} ^ -D BX_CONFIG_DEBUG=ON ^ -D GRAPHICS_API=${{ inputs.graphics-api }} ^