diff --git a/.editorconfig b/.editorconfig index 183566b31bebf4fe3d242739f84f0c63ad79b057..6b724e49e13c4aa8408f45f4b01e2dba9a0744fc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,7 +17,7 @@ insert_final_newline = true trim_trailing_whitespace = true # Override settings. -[*.{json,yaml}] +[*.{json,yml,yaml}] indent_size = 2 # Override settings. diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..9546e3f85afda14542aba40a93136ffc9b59a3c9 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,73 @@ +# +# SPDX-FileCopyrightText: Copyright 2024 Arm Limited and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 +# + +stages: + - build + - test + +default: + image: registry.gitlab.arm.com/kleidi/kleidiai/image:latest + tags: + - arm64 + +.standard-rules: + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + +workflow: + auto_cancel: + on_new_commit: interruptible + +build-clang: + extends: + - .standard-rules + interruptible: true + stage: build + script: + - cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DKLEIDIAI_BUILD_TESTS=ON -S . -B build/ + - cmake --build ./build + artifacts: + paths: + - "build/" + +build-gcc: + extends: + - .standard-rules + interruptible: true + stage: build + script: + - cmake -G Ninja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DKLEIDIAI_BUILD_TESTS=ON -S . -B build/ + - cmake --build ./build + +clang-tidy-checks: + extends: + - .standard-rules + interruptible: true + stage: build + script: + - cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DKLEIDIAI_BUILD_TESTS=ON -DKLEIDIAI_ENABLE_CLANG_TIDY=ON -S . -B build/ + - cmake --build ./build + +pre-commit-hooks: + extends: + - .standard-rules + interruptible: true + stage: build + before_script: + - pre-commit install + script: + - pre-commit run --all-files + +test-linux-aarch64: + extends: + - .standard-rules + interruptible: true + stage: test + dependencies: + - build-clang + script: + - ./build/kleidiai_test diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08ba2f2b0fa122fb7b40d7b37b7a6d6a517f70a5..e6eb382ca1649913a6aaa7157bafa17fc24e1813 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,6 +28,7 @@ repos: hooks: - id: editorconfig-checker alias: ec + stages: [ commit ] name: "EditorConfig Rules" - repo: https://github.com/cmake-lint/cmake-lint rev: 251239e56ab8b88889fec16a47376c44dfa16a99 @@ -65,8 +66,9 @@ repos: alias: signed-off-checker name: "Signed-off Checker (DCO)" entry: python tools/pre-commit/signedoff_checker.py + always_run: true language: python language_version: python3 description: Ensures that latest commit has been signed-off with `--signoff`. pass_filenames: false - stages: [ push ] + stages: [ commit, push ]