Sfoglia il codice sorgente

Ensure Bazel cache is utilized in build workflow

Add a step to ensure Bazel cache is used during the build process.
jimsterino98 4 mesi fa
parent
commit
ff36b37803
1 ha cambiato i file con 20 aggiunte e 0 eliminazioni
  1. 20 0
      .github/workflows/build.yml

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

@@ -265,6 +265,26 @@ jobs:
          android_version: ${{ inputs.android_version }}
          kernel_version: ${{ inputs.kernel_version }}
 
+      - name: ensure bazel cache is used
+        if: inputs.build_type == 'Bazel'
+        run: |
+          cd "$CONFIG"
+          if [ -d kernel_platform ]]; then
+          cd kernel_platform
+          touch .bazelrc
+          cat >> .bazelrc << 'EOF'
+          build --disk_cache=${{ env.BCACHE_DIR }}
+          build --experimental_disk_cache_gc_max_size=1G
+          EOF
+          else
+          touch .bazelrc
+          cat >> .bazelrc << 'EOF'
+          build --disk_cache=${{ env.BCACHE_DIR }}
+          build --experimental_disk_cache_gc_max_size=1G
+          EOF
+          fi
+           
+
       - name: Build
         uses: ./.github/actions/build
         with: