CI: Check static typing with mypy during the functional test
authorAlexander Popov <alex.popov@linux.com>
Mon, 13 May 2024 17:06:16 +0000 (20:06 +0300)
committerAlexander Popov <alex.popov@linux.com>
Mon, 13 May 2024 17:06:16 +0000 (20:06 +0300)
.github/workflows/functional_test.yml
.github/workflows/functional_test_no-coverage.yml
.woodpecker/functional_test.yml

index e197bacb6b8f2ce866b7aac0b2e86731d4eb8207..8a2711f3e13ccabffd7db805c01ed773ed6a9413 100644 (file)
@@ -51,6 +51,11 @@ jobs:
     - name: Get source code for collecting coverage
       uses: actions/checkout@v4
 
+    - name: Check static typing with mypy
+      run: |
+        pip install mypy
+        mypy kernel_hardening_checker/
+
     - name: Run the functional tests and collect the coverage
       run: |
         pip install coverage
index 3d02c5a0b3cdd9dbdf92ca766a3379d87c73e9e2..7d692ee121b1da3f6ee6139a3d8504f9285b12d2 100644 (file)
@@ -51,6 +51,11 @@ jobs:
     - name: Get source code
       uses: actions/checkout@v4
 
+    - name: Check static typing with mypy
+      run: |
+        pip install mypy
+        mypy kernel_hardening_checker/
+
     - name: Run the functional tests
       run: |
         pip install coverage
index 17272f5fc4e86d8a23424cc677b0472ce3c6c3a7..020b1d50a770488deb3578f5cc993e2e335abf9f 100644 (file)
@@ -21,6 +21,14 @@ steps:
       - COUNT=0
       - for C in $KCONFIGS; do COUNT=$(expr $COUNT + 1); echo ">>>>> checking kconfig number $COUNT <<<<<"; kernel-hardening-checker -c $C -l /proc/cmdline -s /tmp/sysctls; done
       - echo "Have checked $COUNT kconfigs"
+  static-typing-checking:
+    image: python:3
+    pull: true
+    commands:
+      - echo "Install the mypy tool..."
+      - python --version
+      - pip install --no-cache-dir mypy
+      - mypy kernel_hardening_checker/
   functional-test-with-coverage:
     image: python:3
     pull: true