From fc693ac0845d332dbe86f41112560755c4743f08 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 10 Sep 2023 22:47:40 +0200 Subject: [PATCH] ci: Fix caching of object files in CD/CI (#9282) --- .github/sccache/action.yml | 14 +++----------- .github/workflows/cd.yaml | 6 ------ .github/workflows/cd_release.yaml | 6 ------ CMakePresets.json | 7 ++----- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/.github/sccache/action.yml b/.github/sccache/action.yml index 2ddddf2b5255..9f7bc577044b 100644 --- a/.github/sccache/action.yml +++ b/.github/sccache/action.yml @@ -1,14 +1,10 @@ name: Install sccache description: Installs sccache for the current platform -inputs: - read-only: - description: Whether the cache should be read-only - default: 'false' runs: using: 'composite' steps: - name: Set environment variables - run: echo "SCCACHE_VERSION=v0.5.4" >> $GITHUB_ENV + run: echo "SCCACHE_VERSION=v0.5.0" >> $GITHUB_ENV shell: bash - name: Download sccache run: | @@ -33,12 +29,8 @@ runs: if: ${{ runner.os == 'Windows' }} run: (Get-Item .).FullName >> $env:GITHUB_PATH shell: pwsh - - name: Write to the cache - if: ${{ inputs.read-only == 'false' && github.event_name == 'push' }} - run: echo "SCCACHE_GHA_CACHE_TO=sccache-${{ github.sha }}" >> $GITHUB_ENV - shell: bash - - name: Read from the cache - run: echo "SCCACHE_GHA_CACHE_FROM=sccache-" >> $GITHUB_ENV + - name: Enable sccache + run: echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV shell: bash - name: Configure sccache uses: actions/github-script@v6 diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index beeed641684e..66e6b5335b4e 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -32,8 +32,6 @@ jobs: sudo apt-get install -y --no-install-recommends libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libgles2-mesa-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev - name: Setup sccache uses: ./.github/sccache - with: - read-only: 'true' - name: Adjust version strings run: ./utils/cd_update_versions.sh - uses: lukka/get-cmake@latest @@ -64,8 +62,6 @@ jobs: show-progress: false - name: Setup sccache uses: ./.github/sccache - with: - read-only: 'true' - name: Adjust version strings run: ./utils/cd_update_versions.sh shell: bash @@ -99,8 +95,6 @@ jobs: show-progress: false - name: Setup sccache uses: ./.github/sccache - with: - read-only: 'true' - name: Install pkg-config run: type -P pkg-config || brew install pkg-config - uses: lukka/get-cmake@latest diff --git a/.github/workflows/cd_release.yaml b/.github/workflows/cd_release.yaml index 0b3a6bfa907e..47be72f609f7 100644 --- a/.github/workflows/cd_release.yaml +++ b/.github/workflows/cd_release.yaml @@ -22,8 +22,6 @@ jobs: sudo apt-get install -y --no-install-recommends libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev libgles2-mesa-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev - name: Setup sccache uses: ./.github/sccache - with: - read-only: 'true' - uses: lukka/get-cmake@latest - uses: lukka/run-vcpkg@v11 with: @@ -90,8 +88,6 @@ jobs: show-progress: false - name: Setup sccache uses: ./.github/sccache - with: - read-only: 'true' - uses: lukka/get-cmake@latest - uses: lukka/run-vcpkg@v11 with: @@ -130,8 +126,6 @@ jobs: show-progress: false - name: Setup sccache uses: ./.github/sccache - with: - read-only: 'true' - name: Install pkg-config run: type -P pkg-config || brew install pkg-config - uses: lukka/get-cmake@latest diff --git a/CMakePresets.json b/CMakePresets.json index e6d998bc3000..588cee7f4cac 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -28,6 +28,7 @@ }, "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CXX_COMPILER_LAUNCHER": "sccache", "CMAKE_COMPILE_WARNING_AS_ERROR": "ON", "ES_USE_SYSTEM_LIBRARIES": "OFF" }, @@ -49,6 +50,7 @@ }, "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", + "CMAKE_COMPILE_WARNING_AS_ERROR": "ON", "ES_USE_SYSTEM_LIBRARIES": "OFF", "BUILD_TESTING": "OFF" }, @@ -182,7 +184,6 @@ "description": "Builds for Linux for CI purposes", "inherits": "ci", "cacheVariables": { - "CMAKE_CXX_COMPILER_LAUNCHER": "sccache", "VCPKG_HOST_TRIPLET": "linux64-release", "VCPKG_TARGET_TRIPLET": "linux64-release", "ES_USE_OFFSCREEN": "ON" @@ -194,7 +195,6 @@ "description": "Builds for Linux GLES for CI purposes", "inherits": "ci", "cacheVariables": { - "CMAKE_CXX_COMPILER_LAUNCHER": "sccache", "VCPKG_HOST_TRIPLET": "linux64-release", "VCPKG_TARGET_TRIPLET": "linux64-release", "ES_GLES": "ON", @@ -207,7 +207,6 @@ "description": "Builds for MacOS for CI purposes", "inherits": "ci", "cacheVariables": { - "CMAKE_CXX_COMPILER_LAUNCHER": "sccache", "VCPKG_HOST_TRIPLET": "macos64-release", "VCPKG_TARGET_TRIPLET": "macos64-release", "CMAKE_OSX_ARCHITECTURES": "x86_64", @@ -220,7 +219,6 @@ "description": "Builds with clang-cl for CI purposes", "inherits": "ci", "cacheVariables": { - "CMAKE_CXX_COMPILER_LAUNCHER": "sccache", "VCPKG_HOST_TRIPLET": "x64-windows-release", "VCPKG_TARGET_TRIPLET": "x64-windows-release", "CMAKE_CXX_COMPILER": "clang-cl.exe" @@ -232,7 +230,6 @@ "description": "Builds with MinGW for CI purposes", "inherits": "ci", "cacheVariables": { - "CMAKE_CXX_COMPILER_LAUNCHER": "sccache", "CMAKE_CXX_COMPILER": "x86_64-w64-mingw32-g++", "CMAKE_RC_COMPILER": "windres", "VCPKG_HOST_TRIPLET": "win64-release",