diff --git a/.gitlab-ci/test-source-dep.yml b/.gitlab-ci/test-source-dep.yml index 1a17b0f9de7..0dbed2d7e86 100644 --- a/.gitlab-ci/test-source-dep.yml +++ b/.gitlab-ci/test-source-dep.yml @@ -921,3 +921,10 @@ - changes: - src/**/*.rs when: on_success + +.lint-clang-format-rules: + rules: + - !reference [.core-rules, rules] + - changes: + - src/**/asahi/**/* + when: on_success diff --git a/.gitlab-ci/test/gitlab-ci.yml b/.gitlab-ci/test/gitlab-ci.yml index 093cc3b92d8..5dd27805d29 100644 --- a/.gitlab-ci/test/gitlab-ci.yml +++ b/.gitlab-ci/test/gitlab-ci.yml @@ -30,6 +30,19 @@ rustfmt: - shopt -s globstar - rustfmt --check --verbose src/**/*.rs +clang-format: + # Cancel job if a newer commit is pushed to the same branch + interruptible: true + stage: lint + extends: + - .use-debian/x86_build + - .lint-clang-format-rules + variables: + GIT_STRATEGY: fetch + script: + - shopt -s globstar + - clang-format-13 --Werror --dry-run src/**/asahi/**/*.{h,c,cpp} + .test-gl: extends: - .test