From a88e0633185026fbd02184061a6f12b004da7fa0 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 13 May 2024 20:06:16 +0300 Subject: [PATCH] CI: Check static typing with mypy during the functional test --- .github/workflows/functional_test.yml | 5 +++++ .github/workflows/functional_test_no-coverage.yml | 5 +++++ .woodpecker/functional_test.yml | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/.github/workflows/functional_test.yml b/.github/workflows/functional_test.yml index e197bac..8a2711f 100644 --- a/.github/workflows/functional_test.yml +++ b/.github/workflows/functional_test.yml @@ -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 diff --git a/.github/workflows/functional_test_no-coverage.yml b/.github/workflows/functional_test_no-coverage.yml index 3d02c5a..7d692ee 100644 --- a/.github/workflows/functional_test_no-coverage.yml +++ b/.github/workflows/functional_test_no-coverage.yml @@ -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 diff --git a/.woodpecker/functional_test.yml b/.woodpecker/functional_test.yml index 17272f5..020b1d5 100644 --- a/.woodpecker/functional_test.yml +++ b/.woodpecker/functional_test.yml @@ -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 -- 2.31.1