Add more tests to increase coverage - III
[kconfig-hardened-check.git] / .github / workflows / main.yml
index 379de5e49da57053be24cd2db333e3ecda19283b..44d3b4e99d6b84a8d718620488a09d55f0802e45 100644 (file)
@@ -20,8 +20,6 @@ jobs:
 
     steps:
 
-#   - uses: actions/checkout@v2
-
     - name: Set up Python ${{ matrix.python-version }}
       uses: actions/setup-python@v1
       with:
@@ -30,10 +28,8 @@ jobs:
     - name: Install
       run: |
         python -m pip install --upgrade pip
+        pip install coverage
         pip --verbose install git+https://github.com/a13xp0p0v/kconfig-hardened-check
-
-    - name: Try
-      run: |
         kconfig-hardened-check
 
     - name: Check all configs
@@ -41,9 +37,44 @@ jobs:
         echo ">>>>> check all configs <<<<<"
         CONFIG_DIR=`find /opt/hostedtoolcache/Python/ -name config_files`
         CONFIGS=`find $CONFIG_DIR -type f|grep "\.config"`
+        COUNT=0
         for C in $CONFIGS
         do
-                echo -e "\n>>>>> checking $C <<<<<"
-                kconfig-hardened-check -c $C || exit
+                COUNT=$(expr $COUNT + 1)
+                echo -e "\n>>>>> checking config number $COUNT <<<<<"
+                kconfig-hardened-check -c $C
         done
-        echo -e "\n>>>>> checking done <<<<<"
+        echo -e "\n>>>>> checking $COUNT configs is done <<<<<"
+
+    - uses: actions/checkout@v2
+
+    - name: Collect coverage
+      run: |
+        coverage run -a --branch bin/kconfig-hardened-check
+
+        coverage run -a --branch bin/kconfig-hardened-check -p X86_64
+        coverage run -a --branch bin/kconfig-hardened-check -p X86_32
+        coverage run -a --branch bin/kconfig-hardened-check -p ARM64
+        coverage run -a --branch bin/kconfig-hardened-check -p ARM
+        coverage run -a --branch bin/kconfig-hardened-check -p X86_64 --debug
+        coverage run -a --branch bin/kconfig-hardened-check -p X86_64 --json
+
+        CONFIG_DIR=`find /opt/hostedtoolcache/Python/ -name config_files`
+        CONFIGS=`find $CONFIG_DIR -type f|grep "\.config"`
+        for C in $CONFIGS
+        do
+                coverage run -a --branch bin/kconfig-hardened-check -c $C
+                coverage run -a --branch bin/kconfig-hardened-check -c $C --debug
+                coverage run -a --branch bin/kconfig-hardened-check -c $C --json
+        done
+        coverage xml -i -o coverage.xml
+
+    - name: Handle coverage
+      uses: codecov/codecov-action@v1
+      with:
+        file: ./coverage.xml
+        flags: functional_test
+        name: codecov-umbrella
+        fail_ci_if_error: true
+
+