Patchwork D9723: ci: avoid a global before_script definition

login
register
mail settings
Submitter phabricator
Date Jan. 12, 2021, 12:07 p.m.
Message ID <differential-rev-PHID-DREV-l5m2dhxl4qfmsbmbfzeq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48033/
State Superseded
Headers show

Comments

phabricator - Jan. 12, 2021, 12:07 p.m.
danchr created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This removes the implicit assumption that all jobs are test runs.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9723

AFFECTED FILES
  contrib/heptapod-ci.yml

CHANGE DETAILS




To: danchr, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/contrib/heptapod-ci.yml b/contrib/heptapod-ci.yml
--- a/contrib/heptapod-ci.yml
+++ b/contrib/heptapod-ci.yml
@@ -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"