Patchwork D9717: contrib: stop building rust for every job

login
register
mail settings
Submitter phabricator
Date Jan. 11, 2021, 8:54 a.m.
Message ID <differential-rev-PHID-DREV-wmzptbc6yjwnvt4fboid-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48028/
State New
Headers show

Comments

phabricator - Jan. 11, 2021, 8:54 a.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is just wasteful for all steps that do not use Rust.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  contrib/heptapod-ci.yml

CHANGE DETAILS




To: Alphare, #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
@@ -5,8 +5,6 @@ 
 before_script:
     - hg clone . /tmp/mercurial-ci/ --noupdate
     - 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
 
@@ -20,6 +18,16 @@ 
         - echo "$RUNTEST_ARGS"
         - HGMODULEPOLICY="$TEST_HGMODULEPOLICY" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS
 
+.rust_template: &rust
+    before_script:
+        - hg clone . /tmp/mercurial-ci/ --noupdate
+        - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
+        - cd /tmp/mercurial-ci/
+        - ls -1 tests/test-check-*.* > /tmp/check-tests.txt
+        - cd /tmp/mercurial-ci/rust/rhg
+        - cargo build
+        - cd /tmp/mercurial-ci/
+
 checks-py2:
     <<: *runtests
     variables:
@@ -69,6 +77,7 @@ 
 
 test-py2-rust:
     <<: *runtests
+    <<: *rust
     variables:
         HGWITHRUSTEXT: cpython
         RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"
@@ -76,6 +85,7 @@ 
 
 test-py3-rust:
     <<: *runtests
+    <<: *rust
     variables:
         HGWITHRUSTEXT: cpython
         RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"