[gjs: 14/15] CI: Skip linter jobs if no linted files modified



commit bfb7de0d381fa774d158e05960e3d57cb72b87f3
Author: Philip Chimento <philip endlessm com>
Date:   Thu Sep 19 17:32:32 2019 -0700

    CI: Skip linter jobs if no linted files modified
    
    This uses GitLab's changes expressions to skip the linter jobs if no
    files were modified in the code being pushed that would be linted by
    that job.
    
    So we only run cpplint and cppcheck for changes to .c, .h, and .cpp
    files, and we only run eslint for changes to .js files.

 .gitlab-ci.yml | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b0c4ea64..1f1d068a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -194,6 +194,11 @@ cppcheck:
       - tags
     variables:
       - $CI_COMMIT_MESSAGE =~ /\[skip cppcheck\]/
+  only:
+    changes:
+      - '**/*.c'
+      - '**/*.cpp'
+      - '**/*.h'
 
 cpplint:
   <<: *build
@@ -208,6 +213,11 @@ cpplint:
       - tags
     variables:
       - $CI_COMMIT_MESSAGE =~ /\[skip cpplint\]/
+  only:
+    changes:
+      - '**/*.c'
+      - '**/*.cpp'
+      - '**/*.h'
 
 eslint:
   when: on_success
@@ -221,6 +231,9 @@ eslint:
       - tags
     variables:
       - $CI_COMMIT_MESSAGE =~ /\[skip eslint\]/
+  only:
+    changes:
+      - '**/*.js'
 
 #############################################
 #                Manual Jobs                #


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