[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [manual/master] test different stages to customise tests for special branches or changes



commit ebc5ba27f837f94d3c2c4ab43c2ccdd58f65c655
Author: emma peel <emma.peel@xxxxxxxxxx>
Date:   Thu Sep 2 12:33:03 2021 +0000

    test different stages to customise tests for special branches or changes
---
 .gitlab-ci.yml | 50 ++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 38 insertions(+), 12 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 061766f..828303f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,15 +1,15 @@
 image: debian:buster-slim
-
-cache:
+       
+cache: 
   key: $CI_PROJECT_PATH_SLUG.${CI_COMMIT_REF_SLUG}
   paths:
     - packages
     - lego
     - apt-cache
-
+       
 # This template should be usable on any system that's based on apt.
 # taken from tor gitlabci
-
+       
 .apt-template: &apt-template |
       export LC_ALL=C.UTF-8
       echo Etc/UTC > /etc/timezone
@@ -25,11 +25,16 @@ cache:
         >> /etc/apt/apt.conf.d/99gitlab
       apt-get update -qq
       apt-get upgrade -qy
-
+       
 variables:
     GIT_SUBMODULE_STRATEGY: recursive
-
-pages:
+       
+stages:
+    - build
+    - test_l10n
+       
+pages: 
+  stage: build
   script:
     - *apt-template
     - DEBIAN_FRONTEND=noninteractive apt-get install gettext python3-babel python3-pip git python3-inifile python3-dev python3-setuptools python3-openssl python3-cryptography i18nspector apt-utils -y
@@ -40,16 +45,37 @@ pages:
     - echo 'checking out translations'
     - rm -rf i18n
     - git clone --branch tbmanual-contentspot https://git.torproject.org/translation.git i18n
-    - echo 'building lektor 3 times to get translations in place'
+    - echo 'reinstall lektor plugins'
     - lektor plugins reinstall
+    - echo 'build lektor'
+    - lektor build --output-path public
+  artifacts:
+    paths:
+      - public
+      - i18n
+      - l10n
+       
+check_new_strings:
+  stage: test_l10n
+  needs: [pages]
+  rules:
+    - changes:
+      - content/*
+      - templates/*
+  script:
+    - echo 'building lektor 3 more times to get translations in place'
     - lektor build --output-path public && lektor build --output-path public && lektor build --output-path public
     - echo 'ok, we built it! now we will make some tests'
     - pip3 install polib
     - git clone https://gitlab.torproject.org/tpo/community/l10n.git
     - echo 'lets see if there are any updates in the strings for translation'
     - l10n/bin/check_po_status.py tbmanual-contentspot
+       
+check_l10n:
+  stage: test_l10n
+  needs: [pages]
+  only:
+    - translations
+  script:
     - echo 'lets see if there are any broken links on the translations'
-    - l10n/bin/check_markdown_links.py i18n/
-  artifacts:
-    paths:
-      - public
+    - l10n/bin/check_markdown_links.py i18n/
\ No newline at end of file



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits