Rename some workflow steps
[kconfig-hardened-check.git] / .github / workflows / main.yml
1 name: functional test
2
3 on:
4   push:
5     branches: [ master ]
6   pull_request:
7     branches: [ master ]
8
9 jobs:
10   check_all_configs:
11
12     runs-on: ubuntu-latest
13
14     strategy:
15       max-parallel: 4
16       fail-fast: false
17       matrix:
18         python-version: [3.6, 3.7, 3.8]
19         # github runner with python 3.5 currently fails to install this package
20
21     steps:
22
23     - name: Set up Python ${{ matrix.python-version }}
24       uses: actions/setup-python@v1
25       with:
26         python-version: ${{ matrix.python-version }}
27
28     - name: Install package
29       run: |
30         python -m pip install --upgrade pip
31         pip install coverage
32         pip --verbose install git+https://github.com/a13xp0p0v/kconfig-hardened-check
33         kconfig-hardened-check
34
35     - name: Check all configs
36       run: |
37         echo ">>>>> check all configs <<<<<"
38         CONFIG_DIR=`find /opt/hostedtoolcache/Python/ -name config_files`
39         CONFIGS=`find $CONFIG_DIR -type f|grep "\.config"`
40         COUNT=0
41         for C in $CONFIGS
42         do
43                 COUNT=$(expr $COUNT + 1)
44                 echo -e "\n>>>>> checking config number $COUNT <<<<<"
45                 kconfig-hardened-check -c $C
46         done
47         echo -e "\n>>>>> checking $COUNT configs is done <<<<<"
48
49     - name: Get source code
50       uses: actions/checkout@v2
51
52     - name: Collect coverage
53       run: |
54         coverage run -a --branch bin/kconfig-hardened-check
55
56         coverage run -a --branch bin/kconfig-hardened-check -p X86_64
57         coverage run -a --branch bin/kconfig-hardened-check -p X86_32
58         coverage run -a --branch bin/kconfig-hardened-check -p ARM64
59         coverage run -a --branch bin/kconfig-hardened-check -p ARM
60         coverage run -a --branch bin/kconfig-hardened-check -p X86_64 --debug
61         coverage run -a --branch bin/kconfig-hardened-check -p X86_64 --json
62
63         CONFIG_DIR=`find /opt/hostedtoolcache/Python/ -name config_files`
64         CONFIGS=`find $CONFIG_DIR -type f|grep "\.config"`
65         for C in $CONFIGS
66         do
67                 coverage run -a --branch bin/kconfig-hardened-check -c $C
68                 coverage run -a --branch bin/kconfig-hardened-check -c $C --debug
69                 coverage run -a --branch bin/kconfig-hardened-check -c $C --json
70         done
71         coverage xml -i -o coverage.xml
72
73     - name: Handle coverage
74       uses: codecov/codecov-action@v1
75       with:
76         file: ./coverage.xml
77         flags: functional_test
78         name: codecov-umbrella
79         fail_ci_if_error: true
80
81