Merge remote-tracking branch 'origin/pylint'
[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/ --show-error-context --pretty --no-incremental --check-untyped-defs --disallow-untyped-defs --strict-equality
32   pylint-checking:
33     image: python:3
34     pull: true
35     commands:
36       - echo "Install the pylint tool..."
37       - python --version
38       - pip install --no-cache-dir pylint
39       - pip install --no-cache-dir setuptools
40       - pylint --recursive=y kernel_hardening_checker setup.py
41   functional-test-with-coverage:
42     image: python:3
43     pull: true
44     commands:
45       - echo "Install the coverage tool..."
46       - python --version
47       - pip install --no-cache-dir coverage
48       - echo "Run the functional tests and collect the coverage..."
49       - sh .github/workflows/functional_test.sh
50       - echo "Show the coverage report..."
51       - coverage report