Skip to content

Commit af1f59c

Browse files
authored
ci: Clean up broken cobalt checkout in depot tools step (#8585)
Improve CI reliability by ensuring a clean state in the depot tools setup step. Previously, inconsistent submodule states could cause checkout failures on runners. This change deinitializes all submodules and performs a deep clean of the cobalt source directory. Bug: 407051026
1 parent ec66001 commit af1f59c

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/actions/depot_tools/action.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ runs:
1717
- name: Clear Cache and Clone Depot Tools
1818
if: inputs.use_cache != 'true'
1919
run: |
20+
set -x
21+
# Remove and re-clone gclient.
2022
rm -rf /runner-cache/depot_tools /runner-cache/cobalt/.cipd_cache
2123
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /runner-cache/depot_tools
24+
25+
# Reset cobalt checkout by deleting all submodules and cleaning all non-tracked files.
26+
git -C /runner-cache/cobalt/src submodule deinit -f --all
2227
git -C /runner-cache/cobalt/src clean -ffdx
2328
shell: bash
2429

.github/workflows/main.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,6 @@ jobs:
340340

341341
- name: Checkout
342342
uses: actions/checkout@v4
343-
# TODO(bug?): android debug builds are broken.
344-
if: ${{ ! (contains(matrix.platform, 'android') && matrix.config == 'debug') }}
345343
with:
346344
path: cobalt/src
347345
# Set fetch-depth to 2 to make checkout faster for pull requests and cobalt_sandbox repo.
@@ -452,8 +450,10 @@ jobs:
452450
include: ${{ fromJson(needs.initialize.outputs.includes) }}
453451
config: [devel]
454452
steps:
455-
- name: Checkout
456-
uses: actions/checkout@v4
453+
- name: Restore CI Essentials
454+
uses: actions/download-artifact@v4
455+
with:
456+
name: ci-essentials-${{ inputs.platform }}
457457
- name: Run E2E Tests
458458
uses: ./.github/actions/internal_tests
459459
with:
@@ -482,8 +482,10 @@ jobs:
482482
include: ${{ fromJson(needs.initialize.outputs.includes) }}
483483
config: [devel]
484484
steps:
485-
- name: Checkout
486-
uses: actions/checkout@v4
485+
- name: Restore CI Essentials
486+
uses: actions/download-artifact@v4
487+
with:
488+
name: ci-essentials-${{ inputs.platform }}
487489
- name: Run YTS Tests
488490
uses: ./.github/actions/internal_tests
489491
with:

0 commit comments

Comments
 (0)