# HG changeset patch # User Anton Shestakov # Date 1593192811 -28800 # Node ID 02804d8bac313835772c25bab5f7521561af51b8 # Parent 06b5e43ac29c50bd4c7c1d1d64f62bb2de80d2ae ci: use a script template to pull and update /ci/repos/mercurial/ diff -r 06b5e43ac29c -r 02804d8bac31 .gitlab-ci.yml --- a/.gitlab-ci.yml Sun Jun 14 00:36:37 2020 +0800 +++ b/.gitlab-ci.yml Sat Jun 27 01:33:31 2020 +0800 @@ -1,9 +1,12 @@ +.prepare_hg: &prepare_hg + - hg pull -R /ci/repos/mercurial/ + - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg identify --branch)") + - hg -R /ci/repos/mercurial/ update "$hg_rev" + pytype: image: octobus/ci-py3-hgext3rd script: - - hg pull -R /ci/repos/mercurial/ - - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") - - hg -R /ci/repos/mercurial/ update "$hg_rev" + - *prepare_hg - pytype --version - jobs=$(python -c 'import multiprocessing; print multiprocessing.cpu_count()') - pytype -P /ci/repos/mercurial/:hgext3rd -k hgext3rd -x hgext3rd/evolve/thirdparty -j $jobs || true @@ -20,9 +23,7 @@ before_script: - (cd tests; ls -1 test-check-*.t > /tmp/check-tests.txt) script: - - hg pull -R /ci/repos/mercurial/ - - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") - - hg -R /ci/repos/mercurial/ update "$hg_rev" + - *prepare_hg - ("$PYTHON" --version) - (cd tests; set -x; HGMODULEPOLICY="$TEST_HGMODULEPOLICY" "$PYTHON" /ci/repos/mercurial/tests/run-tests.py --color=always $RUNTEST_ARGS)