Upload the unit-test coverage to codecov (use a separate flag)
[kconfig-hardened-check.git] / .github / workflows / engine_unit-test.yml
1 name: engine unit-test
2
3 on:
4   push:
5     branches: [ master ]
6   pull_request:
7     branches: [ master ]
8
9 jobs:
10   engine_unit-test:
11
12     runs-on: ubuntu-latest
13
14     strategy:
15       max-parallel: 1
16       fail-fast: false
17       matrix:
18         python-version: ['3.11']
19
20     steps:
21
22     - name: Set up Python ${{ matrix.python-version }}
23       uses: actions/setup-python@v4
24       with:
25         python-version: ${{ matrix.python-version }}
26
27     - name: Get source code for collecting coverage
28       uses: actions/checkout@v3
29
30     - name: Run unit-tests and collect coverage
31       run: |
32         coverage run --include=kconfig_hardened_check/engine.py,kconfig_hardened_check/test_engine.py -m unittest -v
33         coverage xml -i -o coverage_unittest.xml
34
35     - name: Handle coverage
36       uses: codecov/codecov-action@v3
37       with:
38         files: ./coverage_unittest.xml
39         flags: engine_unit-test
40         name: codecov-umbrella
41         fail_ci_if_error: true
42         verbose: true