From cd8cf7df9b06c0080afee8828d35a2fad4533611 Mon Sep 17 00:00:00 2001
From: Timo Furrer <tfurrer@gitlab.com>
Date: Fri, 26 Jan 2024 14:52:31 +0100
Subject: [PATCH] Add rules for when to run integration tests

---
 .gitlab-ci.yml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b55c412..d92a19e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,9 +12,21 @@ include:
           - src/gitlab-tofu.sh
           - Dockerfile
           - .gitlab-ci.yml
+          - tests/unit.gitlab-ci.yml
       - if: $CI_COMMIT_TAG
       - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
   - local: tests/integration.gitlab-ci.yml
+    rules:
+      - changes:
+          - src/gitlab-tofu.sh
+          - Dockerfile
+          - .gitlab-ci.yml
+          - templates/*.yml
+          - tests/integration.gitlab-ci.yml
+          - tests/integration-tests/*.yml
+          - tests/terraform/**.tf
+          - backports/*.gitlab-ci.yml
+          - backports/OpenTofu/*.gitlab-ciyml
   - component: gitlab.com/components/container-scanning/container-scanning@1.0
     inputs:
       stage: quality
-- 
GitLab