Skip build, test, analysis/lint when we don't make code changes
authorMark Felder <feld@feld.me>
Wed, 2 Jun 2021 17:00:45 +0000 (12:00 -0500)
committerMark Felder <feld@feld.me>
Wed, 2 Jun 2021 17:03:34 +0000 (12:03 -0500)
.gitlab-ci.yml

index 78e715d47396b3c7a6065cd0b7dbcb7d1980afb9..8b2f1115361b14a1e972a1ad2e5a17d56fdc8f4f 100644 (file)
@@ -37,6 +37,11 @@ after_script:
 
 build:
   stage: build
+  only:
+    changes:
+      - "**/*.ex"
+      - "**/*.exs"
+      - "mix.lock"
   script:
   - mix compile --force
 
@@ -64,6 +69,11 @@ benchmark:
 
 unit-testing:
   stage: test
+  only:
+    changes:
+      - "**/*.ex"
+      - "**/*.exs"
+      - "mix.lock"
   retry: 2
   cache: &testing_cache_policy
     <<: *global_cache_policy
@@ -97,6 +107,11 @@ unit-testing:
 
 unit-testing-rum:
   stage: test
+  only:
+    changes:
+      - "**/*.ex"
+      - "**/*.exs"
+      - "mix.lock"
   retry: 2
   cache: *testing_cache_policy
   services:
@@ -115,12 +130,22 @@ unit-testing-rum:
 
 lint:
   stage: test
+  only:
+    changes:
+      - "**/*.ex"
+      - "**/*.exs"
+      - "mix.lock"
   cache: *testing_cache_policy
   script:
     - mix format --check-formatted
 
 analysis:
   stage: test
+  only:
+    changes:
+      - "**/*.ex"
+      - "**/*.exs"
+      - "mix.lock"
   cache: *testing_cache_policy
   script:
     - mix credo --strict --only=warnings,todo,fixme,consistency,readability