Quellcode durchsuchen

Add CodeChecks workflow (#109)

* Add CodeChecks workflow
* Update CodeChecks workflow triggers

Signed-off-by: alek-kam-robotec-ai <[email protected]>
alek-kam-robotec-ai vor 3 Jahren
Ursprung
Commit
30e7b3788f
2 geänderte Dateien mit 55 neuen und 0 gelöschten Zeilen
  1. 45 0
      Gems/ROS2/.github/workflows/CodeChecks.yml
  2. 10 0
      Gems/ROS2/.licenserc.yaml

+ 45 - 0
Gems/ROS2/.github/workflows/CodeChecks.yml

@@ -0,0 +1,45 @@
+name: CodeChecks
+
+on:
+  pull_request:
+    types: [opened, reopened]
+    branches:
+      - development
+
+permissions:
+  contents: read
+
+jobs:
+  clang-format:
+    name: Check code formatting with clang-format-13
+    runs-on: ubuntu-20.04
+    steps:
+      - name: Clone the Gem repository
+        uses: actions/checkout@v3
+      - name: Clone the run-clang-format repository
+        uses: actions/checkout@v3
+        with:
+          repository: Sarcasm/run-clang-format
+          ref: 39081c9c42768ab5e8321127a7494ad1647c6a2f
+          path: run-clang-format
+      - name: Install clang-format-13
+        run: |
+          wget https://apt.llvm.org/llvm.sh
+          chmod +x llvm.sh
+          sudo ./llvm.sh 13
+          sudo apt update && sudo apt install clang-format-13
+      - name: Run the 'run-clang-format.py' file
+        run: |
+          cp run-clang-format/run-clang-format.py run-clang-format.py
+          sudo rm -r run-clang-format
+          ./run-clang-format.py -r --style=file --clang-format-executable=clang-format-13 Code
+
+  license:
+    name: Check license headers
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+      - uses: apache/[email protected]
+        with:
+          mode: check
+          config: .licenserc.yaml

+ 10 - 0
Gems/ROS2/.licenserc.yaml

@@ -0,0 +1,10 @@
+header:
+  license:
+    content: |
+      Copyright (c) Contributors to the Open 3D Engine Project.
+      For complete copyright and license terms please see the LICENSE at the root of this distribution.
+      
+      SPDX-License-Identifier: Apache-2.0 OR MIT
+  paths:
+    - 'Code'
+    - 'CMakeLists.txt'