Explorar o código

Ensure Bazel cache is utilized in build workflow

Add a step to ensure Bazel cache is used during the build process.
jimsterino98 hai 4 meses
pai
achega
ff36b37803
Modificáronse 1 ficheiros con 20 adicións e 0 borrados
  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: