]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gitlab-ci: dedup instructions to disable realtime monitoring
authorPatrick Steinhardt <ps@pks.im>
Thu, 2 Oct 2025 11:04:36 +0000 (13:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Oct 2025 16:44:41 +0000 (09:44 -0700)
The instruction to disable realtime monitoring are shared across all of
our Windows-based jobs. Deduplicate it so that we can more readily
iterate on it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.gitlab-ci.yml

index cf122e706f24e7b0a8382a4a1edee5bf9509c483..552c033fb0b72b108eeb2b243c38e39d1261393b 100644 (file)
@@ -112,6 +112,9 @@ test:osx:
       - t/failed-test-artifacts
     when: on_failure
 
+.windows_before_script: &windows_before_script
+  - Set-MpPreference -DisableRealtimeMonitoring $true
+
 build:mingw64:
   stage: build
   tags:
@@ -119,7 +122,7 @@ build:mingw64:
   variables:
     NO_PERL: 1
   before_script:
-    - Set-MpPreference -DisableRealtimeMonitoring $true
+    - *windows_before_script
     - ./ci/install-sdk.ps1 -directory "git-sdk"
   script:
     - git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
@@ -136,7 +139,7 @@ test:mingw64:
     - job: "build:mingw64"
       artifacts: true
   before_script:
-    - Set-MpPreference -DisableRealtimeMonitoring $true
+    - *windows_before_script
     - git-sdk/usr/bin/bash.exe -l -c 'tar xf artifacts/artifacts.tar.gz'
     - New-Item -Path .git/info -ItemType Directory
     - New-Item .git/info/exclude -ItemType File -Value "/git-sdk"
@@ -150,7 +153,7 @@ test:mingw64:
   tags:
     - saas-windows-medium-amd64
   before_script:
-    - Set-MpPreference -DisableRealtimeMonitoring $true
+    - *windows_before_script
     - choco install -y git meson ninja openssl
     - Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
     - refreshenv