From 3037bf7f41f083308bb836e2c52558c40cafaf1b Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Fri, 14 Feb 2020 18:07:08 +0200
Subject: [PATCH] [ci] #118: Introduce code_changes for format, type, and lint
 jobs

- To save runners CPU for a check not needed
- Add missing examples folder
---
 .gitlab-ci.yml | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c64ba1f4..0315308b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,18 +29,26 @@ image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
     # github push
     - bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"
 
+.code_changes:
+  only:
+    changes:
+      - duniterpy/**/*.py
+      - tests/**/*.py
+      - examples/*.py
+
 .changes:
   rules:
     - changes:
       - duniterpy/**/*.py
+      - tests/**/*.py
+      - examples/*.py
       - .gitlab-ci.yml
       - Makefile
-      - tests/**/*.py
       - pyproject.toml
 
 format:
   extends:
-    - .changes
+    - .code_changes
   stage: checks
   script:
     - make check-format
@@ -54,14 +62,14 @@ build:
 
 type:
   extends:
-    - .changes
+    - .code_changes
   stage: checks
   script:
     - make mypy
 
 lint:
   extends:
-    - .changes
+    - .code_changes
   stage: tests
   tags: [redshift]
   script:
-- 
GitLab