From f6cda5fd200c001599b4ed91910d25432e0994ed Mon Sep 17 00:00:00 2001
From: Robert Rosca <robert.rosca@xfel.eu>
Date: Fri, 12 Apr 2024 14:03:05 +0200
Subject: [PATCH] ci: use `default` section to configure `before_script`

---
 .gitlab-ci.yml | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 124a0fab1..b7025f39e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,7 +3,7 @@ stages:
   - test
   - automated_test
 
-.before_script: &before_script
+default:
   before_script:
     - eval $(ssh-agent -s)
     - echo "$SSH_PRIVATE_KEY_GITLAB" | tr -d '\r' | ssh-add -
@@ -25,7 +25,6 @@ checks:
   stage: check
   only: [merge_requests]
   allow_failure: true
-  <<: *before_script
   script:
     - export PATH=/home/gitlab-runner/.local/bin:$PATH
     #  We'd like to run the pre-commit hooks only on files that are being
@@ -42,7 +41,6 @@ checks:
 pytest:
   stage: test
   only: [merge_requests]
-  <<: *before_script
   script:
     - export LANG=C  # Hopefully detect anything relying on locale
     - python3 -m pip install ".[test]"
@@ -66,7 +64,6 @@ automated_test:
   allow_failure: false
   tags:
     - integration
-  <<: *before_script
   script:
     - export LANG=C  # Hopefully detect anything relying on locale
     - python3 -m pip install ".[test]"
@@ -78,7 +75,6 @@ automated_test:
 cython-editable-install-test:
   stage: test
   only: [merge_requests]
-  <<: *before_script
   script:
     - python3 -m pip install -e ".[test]"
     - python3 -m pytest --color yes --verbose ./tests/test_cythonalgs.py
-- 
GitLab