From 81c4776e884c4c2c56a7ac5fd33ae5095c9d18b5 Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Tue, 8 Aug 2023 11:39:03 -0500 Subject: [PATCH] [ci] Don't checkout monodroid's unneeded XA submodule (#8231) Today, our CI checks out the private `monodroid` repository in order to build its proprietary code. Checking this repository out recursively with its submodules can take quite a lot of time. A large portion of this time is checking out a `xamarin-android` submodule. However, we do not use this submodule, in fact we immediately delete it to ensure that it does not get used. Ideally we would not spend the time checking out this submodule just to delete it, however this is trickier than one might expect. The solution that seems to work is: - Check out `monodroid` without any submodules - Use `git config submodule."external/xamarin-android".update none` to tell `git` to ignore the submodule - Check out `monodroid` with recursive submodules, but `git` will skip XA This saves about 2-3 minutes on an XA PR Mac Build: | Action | Duration| | --- | --- | | `main` `monodroid` checkout | 4:47 | | PR `monodroid` checkout | 2:30 | --- .../automation/yaml-templates/commercial-build.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml index d1a6a3e4977..8c173e15f67 100644 --- a/build-tools/automation/yaml-templates/commercial-build.yaml +++ b/build-tools/automation/yaml-templates/commercial-build.yaml @@ -32,9 +32,18 @@ steps: workingDirectory: ${{ parameters.xaSourcePath }} displayName: make prepare-update-mono -# Clone and prepare monodroid with submodules, but disregard the unused xamarin-android submodule. +# Clone 'monodroid' without submodules - checkout: monodroid clean: true + path: s/xamarin-android/external/monodroid + +# Tell git to ignore the 'xamarin-android' submodule, which is large and unneeded +- script: git config submodule."external/xamarin-android".update none + workingDirectory: xamarin-android/external/monodroid + displayName: Ignore XA submodule + +# Clone 'monodroid' with the rest of the submodules +- checkout: monodroid submodules: recursive path: s/xamarin-android/external/monodroid persistCredentials: true