ci: avoid a global before_script definition
authorDan Villiom Podlaski Christiansen <danchr@gmail.com>
Mon, 11 Jan 2021 15:16:36 +0100
changeset 46244 fb69b51b4daa
parent 46243 63c923fd7fa8
child 46245 db2bc9e667a1
ci: avoid a global before_script definition This removes the implicit assumption that all jobs are test runs. Differential Revision: https://phab.mercurial-scm.org/D9723
contrib/heptapod-ci.yml
--- a/contrib/heptapod-ci.yml	Mon Dec 21 15:50:01 2020 +0100
+++ b/contrib/heptapod-ci.yml	Mon Jan 11 15:16:36 2021 +0100
@@ -4,22 +4,21 @@
 
 image: registry.heptapod.net/mercurial/ci-images/mercurial-core
 
-# The runner made a clone as root.
-# We make a new clone owned by user used to run the step.
-before_script:
-    - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no
-    - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
-    - cd /tmp/mercurial-ci/rust/rhg
-    - cargo build
-    - cd /tmp/mercurial-ci/
-    - ls -1 tests/test-check-*.* > /tmp/check-tests.txt
-
 variables:
     PYTHON: python
     TEST_HGMODULEPOLICY: "allow"
 
 .runtests_template: &runtests
     stage: tests
+    # The runner made a clone as root.
+    # We make a new clone owned by user used to run the step.
+    before_script:
+      - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no
+      - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
+      - cd /tmp/mercurial-ci/rust/rhg
+      - cargo build
+      - cd /tmp/mercurial-ci/
+      - ls -1 tests/test-check-*.* > /tmp/check-tests.txt
     script:
         - echo "python used, $PYTHON"
         - echo "$RUNTEST_ARGS"