diff --git a/.github/workflows/CI-cygwin.yml b/.github/workflows/CI-cygwin.yml index ed351f7283e7..e97347762c41 100644 --- a/.github/workflows/CI-cygwin.yml +++ b/.github/workflows/CI-cygwin.yml @@ -26,6 +26,7 @@ jobs: arch: [x64] include: - platform: 'x86_64' + # python3 is necessary so we can execute addons packages: | gcc-g++ python3 @@ -42,6 +43,19 @@ jobs: platform: ${{ matrix.arch }} packages: ${{ matrix.packages }} + - name: Set up Python 3.12.3 + uses: actions/setup-python@v5 + with: + python-version: '3.12.3' + check-latest: true + + - name: Install missing Python packages + run: | + python -m pip install pip --upgrade || exit /b !errorlevel! + python -m pip install pytest || exit /b !errorlevel! + python -m pip install pytest-custom_exit_code || exit /b !errorlevel! + python -m pip install pytest-timeout || exit /b !errorlevel! + # Cygwin will always link the binaries even if they already exist. The linking is also extremely slow. So just run the "check" target which includes all the binaries. - name: Build all and run test run: | @@ -54,5 +68,10 @@ jobs: python3 ..\misra.py -verify misra\misra-test.c.dump ..\..\cppcheck.exe --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c + - name: Run test/cli + run: | + cd test/cli + python3 -m pytest -Werror --strict-markers -vv + # TODO: add python tests diff --git a/.github/workflows/CI-mingw.yml b/.github/workflows/CI-mingw.yml index d0b69b344691..e9a12bb0ae50 100644 --- a/.github/workflows/CI-mingw.yml +++ b/.github/workflows/CI-mingw.yml @@ -39,6 +39,12 @@ jobs: install: >- mingw-w64-x86_64-lld mingw-w64-x86_64-ccache + python3-pip + + - name: Install missing Python packages + run: | + python -m pip install pytest + python -m pip install pytest-timeout - name: ccache uses: hendrikmuhs/ccache-action@v1.2.11 @@ -70,4 +76,16 @@ jobs: env: LDFLAGS: -fuse-ld=lld # use lld for faster linking + - name: Extra test for misra + run: | + cd addons/test + ../../cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra/misra-test.c --std=c89 --platform=unix64 + python3 ../misra.py -verify misra/misra-test.c.dump + ../../cppcheck --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra/misra-ctu-1-test.c misra/misra-ctu-2-test.c + + - name: Run test/cli + run: | + cd test/cli + python3 -m pytest -Werror --strict-markers -vv + # TODO: add python tests