CI: Check static typing with mypy during the functional test
[kconfig-hardened-check.git] / .woodpecker / functional_test.yml
1 # .woodpecker.yml
2 steps:
3   installation-test:
4     image: python:3
5     pull: true
6     commands:
7       - echo "Prepare for the installation..."
8       - cd ..
9       - pwd
10       - ls -la
11       - python --version
12       - echo "Install the package via pip..."
13       - pip --verbose install --no-cache-dir git+https://github.com/a13xp0p0v/kernel-hardening-checker
14       - echo "Run the installed tool..."
15       - which kernel-hardening-checker
16       - kernel-hardening-checker
17       - echo "Check all configs with the installed tool..."
18       - sysctl -a > /tmp/sysctls
19       - CONFIG_DIR=`find /usr/local/lib/ -name config_files`
20       - KCONFIGS=`find $CONFIG_DIR -type f | grep -e "\.config" -e "\.gz"`
21       - COUNT=0
22       - 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
23       - echo "Have checked $COUNT kconfigs"
24   static-typing-checking:
25     image: python:3
26     pull: true
27     commands:
28       - echo "Install the mypy tool..."
29       - python --version
30       - pip install --no-cache-dir mypy
31       - mypy kernel_hardening_checker/
32   functional-test-with-coverage:
33     image: python:3
34     pull: true
35     commands:
36       - echo "Install the coverage tool..."
37       - python --version
38       - pip install --no-cache-dir coverage
39       - echo "Run the functional tests and collect the coverage..."
40       - sh .github/workflows/functional_test.sh
41       - echo "Show the coverage report..."
42       - coverage report