From 2c9242fb8133ee5000e7bc63fb1ee10002835263 Mon Sep 17 00:00:00 2001
From: Mira Ressel <mira@parity.io>
Date: Wed, 15 Mar 2023 19:19:12 +0100
Subject: [PATCH] timestamp ci job logs (#6890)

---
 polkadot/.gitlab-ci.yml                      | 18 +++++++++++++-----
 polkadot/scripts/ci/gitlab/pipeline/test.yml |  3 +--
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/polkadot/.gitlab-ci.yml b/polkadot/.gitlab-ci.yml
index 7ec774723e7..a6ebde20a86 100644
--- a/polkadot/.gitlab-ci.yml
+++ b/polkadot/.gitlab-ci.yml
@@ -48,6 +48,11 @@ default:
       - api_failure
   interruptible: true
 
+.common-before-script:
+  before_script:
+    - !reference [.job-switcher, before_script]
+    - !reference [.timestamp, before_script]
+
 .collect-artifacts:
   artifacts:
     name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
@@ -68,7 +73,6 @@ default:
 # they will be used if the job fails
 .pipeline-stopper-vars:
   before_script:
-    - !reference [.job-switcher, before_script]
     - echo "FAILED_JOB_URL=${CI_JOB_URL}" > pipeline-stopper.env
     - echo "FAILED_JOB_NAME=${CI_JOB_NAME}" >> pipeline-stopper.env
     - echo "FAILED_JOB_NAME=${CI_JOB_NAME}" >> pipeline-stopper.env
@@ -86,20 +90,20 @@ default:
 .kubernetes-env:
   image: "${CI_IMAGE}"
   before_script:
-    - !reference [.job-switcher, before_script]
+    - !reference [.common-before-script, before_script]
   tags:
     - kubernetes-parity-build
 
 .docker-env:
   image: "${CI_IMAGE}"
   before_script:
-    - !reference [.job-switcher, before_script]
+    - !reference [.common-before-script, before_script]
   tags:
     - linux-docker-vm-c2
 
 .compiler-info:
   before_script:
-    - !reference [.job-switcher, before_script]
+    - !reference [.common-before-script, before_script]
     - rustup show
     - cargo --version
 
@@ -154,7 +158,7 @@ default:
 
 .build-push-image:
   before_script:
-    - !reference [.job-switcher, before_script]
+    - !reference [.common-before-script, before_script]
     - test -s ./artifacts/VERSION || exit 1
     - test -s ./artifacts/EXTRATAG || exit 1
     - VERSION="$(cat ./artifacts/VERSION)"
@@ -196,6 +200,10 @@ include:
   - scripts/ci/gitlab/pipeline/publish.yml
   # zombienet jobs
   - scripts/ci/gitlab/pipeline/zombienet.yml
+  # timestamp handler
+  - project: parity/infrastructure/ci_cd/shared
+    ref: v0.1
+    file: /common/timestamp.yml
 
 #### stage:                        .post
 
diff --git a/polkadot/scripts/ci/gitlab/pipeline/test.yml b/polkadot/scripts/ci/gitlab/pipeline/test.yml
index 3c94fe31b46..31224a6d1ca 100644
--- a/polkadot/scripts/ci/gitlab/pipeline/test.yml
+++ b/polkadot/scripts/ci/gitlab/pipeline/test.yml
@@ -33,8 +33,7 @@ test-linux-stable:
     - .common-refs
     - .pipeline-stopper-artifacts
   before_script:
-    - rustup show
-    - cargo --version
+    - !reference [.compiler-info, before_script]
     - !reference [.pipeline-stopper-vars, before_script]
   variables:
     RUST_TOOLCHAIN: stable
-- 
GitLab