Ver Fonte

ci: remove prepare-ccache job, fetch ccache per-build

Drop shared ccache-binary artifact; each build fetches
ccache-x86-64 directly from kernel_patches when needed
(handled in cache-ccache-setup, gated by use_cache + version).

Retains OnePlus proven lean cache flow (restore/save via
release buckets) without central download bottleneck.
TheWildJames há 1 semana atrás
pai
commit
c817c03895

+ 7 - 15
.github/actions/cache-ccache-setup/action.yml

@@ -18,21 +18,13 @@ runs:
       run: |
         set -euo pipefail
         echo "Installing ccache..."
-
-        if [ -s "${{ github.workspace }}/ccache-dl/ccache" ]; then
-          sudo cp -f "${{ github.workspace }}/ccache-dl/ccache" /usr/bin/ccache
-          sudo chmod +x /usr/bin/ccache
-          rm -rf "${{ github.workspace }}/ccache-dl"
-          echo "[+] installed from shared artifact"
-        else
-          curl -LfsS --retry 5 --retry-delay 5 --retry-all-errors --connect-timeout 30 \
-            -H "User-Agent: Mozilla/5.0" \
-            "https://github.com/WildKernels/kernel_patches/raw/refs/heads/main/ccache/ccache-x86-64" -o ccache
-          sudo cp -f ./ccache /usr/bin/ccache
-          sudo chmod +x /usr/bin/ccache
-          rm -f ./ccache
-          echo "[+] installed from download"
-        fi
+        curl -LfsS --retry 5 --retry-delay 5 --retry-all-errors --connect-timeout 30 \
+          -H "User-Agent: Mozilla/5.0" \
+          "https://github.com/WildKernels/kernel_patches/raw/refs/heads/main/ccache/ccache-x86-64" -o ccache
+        sudo cp -f ./ccache /usr/bin/ccache
+        sudo chmod +x /usr/bin/ccache
+        rm -f ./ccache
+        echo "[+] installed ccache from kernel_patches"
 
         if ! /usr/bin/ccache --version > /dev/null 2>&1; then
           echo "[-] ccache installation failed"

+ 0 - 8
.github/workflows/build.yml

@@ -384,14 +384,6 @@ jobs:
         if-no-files-found: ignore
         compression-level: 9
 
-    - name: Get prebuilt ccache (downloaded once by prepare-ccache)
-      if: false
-      uses: actions/download-artifact@v8
-      with:
-        name: ccache-binary
-        path: ccache-dl
-      continue-on-error: true
-
     - name: 'Setup Cache and Build Environment'
       if: inputs.use_cache
       uses: ./.github/actions/cache-setup

+ 0 - 41
.github/workflows/main.yml

@@ -105,40 +105,6 @@ on:
         default: true
 
 jobs:
-  prepare-ccache:
-    name: Prepare ccache binary (download once)
-    runs-on: ubuntu-latest
-    steps:
-      - name: Download custom ccache once
-        if: inputs.use_cache
-        run: |
-          set -uo pipefail
-          echo "::group::Download ccache"
-          url="https://raw.githubusercontent.com/WildKernels/kernel_patches/refs/heads/main/ccache/ccache-x86-64"
-          ok=0
-          for attempt in 1 2 3 4 5 6; do
-            if curl -LfsS --connect-timeout 30 --max-time 120 -H "User-Agent: Mozilla/5.0" "$url" -o ccache && [ -s ccache ]; then
-              ok=1; break
-            fi
-            echo "attempt $attempt failed (GitHub raw 504/throttle); backing off..."
-            sleep $(( attempt * 5 + RANDOM % 6 ))
-          done
-          if [ "$ok" = 1 ]; then
-            echo "[+] downloaded ccache once for all matrix jobs"
-          else
-            echo "::warning::custom ccache download failed; matrix jobs will fall back to the apt ccache"
-            rm -f ccache
-          fi
-          echo "::endgroup::"
-      - name: Upload ccache artifact
-        if: inputs.use_cache
-        uses: actions/upload-artifact@v7
-        with:
-          name: ccache-binary
-          path: ccache
-          retention-days: 1
-          if-no-files-found: warn
-
   resolve-sources:
     runs-on: ubuntu-latest
     outputs:
@@ -605,7 +571,6 @@ jobs:
 
   build-android12-5-10:
     needs:
-    - prepare-ccache
     - resolve-sources
     - build-nomount-module
     - publish-manager-artifacts
@@ -635,7 +600,6 @@ jobs:
 
   build-android13-5-10:
     needs:
-    - prepare-ccache
     - resolve-sources
     - build-nomount-module
     - publish-manager-artifacts
@@ -665,7 +629,6 @@ jobs:
 
   build-android13-5-15:
     needs:
-    - prepare-ccache
     - resolve-sources
     - build-nomount-module
     - publish-manager-artifacts
@@ -695,7 +658,6 @@ jobs:
 
   build-android14-5-15:
     needs:
-    - prepare-ccache
     - resolve-sources
     - build-nomount-module
     - publish-manager-artifacts
@@ -725,7 +687,6 @@ jobs:
 
   build-android14-6-1:
     needs:
-    - prepare-ccache
     - resolve-sources
     - build-nomount-module
     - publish-manager-artifacts
@@ -755,7 +716,6 @@ jobs:
 
   build-android15-6-6:
     needs:
-    - prepare-ccache
     - resolve-sources
     - build-nomount-module
     - publish-manager-artifacts
@@ -785,7 +745,6 @@ jobs:
 
   build-android16-6-12:
     needs:
-    - prepare-ccache
     - resolve-sources
     - build-nomount-module
     - publish-manager-artifacts