CI: Move to codecov-action@4
[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@v5
24       with:
25         python-version: ${{ matrix.python-version }}
26
27     - name: Get source code for collecting coverage
28       uses: actions/checkout@v4
29
30     - name: Install coverage
31       run: |
32         python -m pip install --upgrade pip
33         pip install coverage
34
35     - name: Run unit-tests and collect coverage
36       run: |
37         coverage run --include=kernel_hardening_checker/engine.py,kernel_hardening_checker/test_engine.py -m unittest -v -b
38         coverage xml -i -o coverage_unittest.xml
39
40     - name: Handle coverage
41       uses: codecov/codecov-action@v4
42       env:
43         CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
44       with:
45         files: ./coverage_unittest.xml
46         flags: engine_unit-test
47         name: engine_unit-test_upload
48         fail_ci_if_error: true
49         verbose: true