mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 02:26:16 +00:00
ci: Refactor paths, and only build containers for CI path changes
This commit is contained in:
parent
c8c5d6444e
commit
e3d345d428
|
@ -15,6 +15,26 @@
|
||||||
# Outside of monado.
|
# Outside of monado.
|
||||||
- if: &is-forked-branch '$CI_PROJECT_NAMESPACE != "monado" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
|
- if: &is-forked-branch '$CI_PROJECT_NAMESPACE != "monado" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
|
||||||
when: manual
|
when: manual
|
||||||
|
# GitLab CI paths
|
||||||
|
- changes: &paths-ci-files
|
||||||
|
- ".gitlab-ci.yml"
|
||||||
|
- ".gitlab-ci/**/*"
|
||||||
|
when: on_success
|
||||||
|
# All paths, 1 hours have been wasted trying to combine the above arrays.
|
||||||
|
- changes: &paths-ci-code-sys-files
|
||||||
|
# Code
|
||||||
|
- "scripts/**/*"
|
||||||
|
- "src/**/*"
|
||||||
|
# Build sys
|
||||||
|
- CMakeLists.txt
|
||||||
|
- "*.cmake"
|
||||||
|
- "**/*.gradle"
|
||||||
|
- "cmake/**/*"
|
||||||
|
- "gradle/**/*"
|
||||||
|
# CI paths
|
||||||
|
- ".gitlab-ci.yml"
|
||||||
|
- ".gitlab-ci/**/*"
|
||||||
|
when: on_success
|
||||||
|
|
||||||
|
|
||||||
# When to automatically run the CI for build jobs
|
# When to automatically run the CI for build jobs
|
||||||
|
@ -22,19 +42,8 @@
|
||||||
rules:
|
rules:
|
||||||
# If any files affecting the pipeline are changed, build/test jobs run
|
# If any files affecting the pipeline are changed, build/test jobs run
|
||||||
# automatically once all dependency jobs have passed
|
# automatically once all dependency jobs have passed
|
||||||
- changes: &all_paths
|
- changes:
|
||||||
# build sys
|
*paths-ci-code-sys-files
|
||||||
- CMakeLists.txt
|
|
||||||
- "*.cmake"
|
|
||||||
- "**/*.gradle"
|
|
||||||
- "cmake/**/*"
|
|
||||||
- "gradle/**/*"
|
|
||||||
# GitLab CI
|
|
||||||
- ".gitlab-ci.yml"
|
|
||||||
- ".gitlab-ci/**/*"
|
|
||||||
# Source code
|
|
||||||
- "scripts/**/*"
|
|
||||||
- "src/**/*"
|
|
||||||
when: on_success
|
when: on_success
|
||||||
# Don't build on forked repos.
|
# Don't build on forked repos.
|
||||||
- if: *is-forked-branch
|
- if: *is-forked-branch
|
||||||
|
@ -48,20 +57,19 @@
|
||||||
# configuration files were changed, to ensure docker images are up to date
|
# configuration files were changed, to ensure docker images are up to date
|
||||||
- if: *is-post-merge
|
- if: *is-post-merge
|
||||||
changes:
|
changes:
|
||||||
- ".gitlab-ci.yml"
|
*paths-ci-files
|
||||||
- ".gitlab-ci/**/*"
|
|
||||||
when: on_success
|
when: on_success
|
||||||
# Run pipeline by default if it is for a merge request, and any files
|
# Run pipeline by default if it is for a merge request, and any files
|
||||||
# affecting the pipeline were changed
|
# affecting the pipeline were changed
|
||||||
- if: *is-pre-merge
|
- if: *is-pre-merge
|
||||||
changes:
|
changes:
|
||||||
*all_paths
|
*paths-ci-files
|
||||||
when: on_success
|
when: on_success
|
||||||
# Allow triggering jobs manually in other cases if any files affecting the
|
# Allow triggering jobs manually in other cases if any files affecting the
|
||||||
# pipeline were changed: Disabled for now because it causes the pipeline on
|
# pipeline were changed: Disabled for now because it causes the pipeline on
|
||||||
# main to be blocked because it gets stuck in the container stage.
|
# main to be blocked because it gets stuck in the container stage.
|
||||||
#- changes:
|
#- changes:
|
||||||
# *all_paths
|
# *paths-ci-files
|
||||||
# when: manual
|
# when: manual
|
||||||
# Don't build on forked repos.
|
# Don't build on forked repos.
|
||||||
- if: *is-forked-branch
|
- if: *is-forked-branch
|
||||||
|
|
Loading…
Reference in a new issue