JenkinsJobs/Windows/ZenUnitAndMetalMock-VTuneHotspots-ZenUnitLibraryT… #224
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ZenUnitAndMetalMock | |
on: [push] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
cmake_build_type: [Debug, Release] | |
cxx: [g++-11] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }} | |
- name: Install lld and ninja-build | |
run: sudo apt-get install lld ninja-build | |
- name: Install lcov Perl dependencies if g++-11 Release | |
run: sudo apt-get install libcapture-tiny-perl libdatetime-perl | |
if: ${{ matrix.cxx == 'g++-11' && matrix.cmake_build_type == 'Release' }} | |
- name: Install pip packages | |
run: pip install --upgrade --upgrade-strategy eager -r dev-requirements.txt | |
- name: Mypy, Flake8, Pylint, then run unit tests with coverage and pytest if g++-11 Release | |
run: python ZenUnitDevOpsPython/MypyFlake8PylintThenRunTestsWithCoverage.py --run-tests-with-coverage-python-file=ZenUnitDevOpsPythonTests/RunAllWithCoverage.py | |
env: | |
PYTHONPATH: "." | |
if: ${{ matrix.cxx == 'g++-11' && matrix.cmake_build_type == 'Release' }} | |
- name: Upload Python code coverage if g++-11 Release | |
uses: codecov/codecov-action@v4 | |
with: | |
files: ZenUnitDevOpsPythonTests/CoberturaCodeCoverageResults_ZenUnitDevOpsPythonTests.xml | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
if: ${{ matrix.cxx == 'g++-11' && matrix.cmake_build_type == 'Release' }} | |
- name: Run BuildAndTestZenUnitAndMetalMock.py in non code coverage mode if clang++ Debug/Release or g++-11 Debug | |
run: | | |
python ZenUnitDevOpsPython/BuildAndTestZenUnitAndMetalMock.py \ | |
--cmake-generator=Ninja \ | |
--cmake-build-type="${{ matrix.cmake_build_type }}" \ | |
--cmake-definitions="" | |
env: | |
CXX: "/usr/bin/${{ matrix.cxx }}" | |
PYTHONPATH: . | |
if: ${{ matrix.cxx == 'clang++' || (matrix.cxx == 'g++-11' && matrix.cmake_build_type == 'Debug') }} | |
- name: Run BuildAndTestZenUnitAndMetalMock.py in code coverage mode if g++-11 Release | |
run: | | |
python ZenUnitDevOpsPython/BuildAndTestZenUnitAndMetalMock.py \ | |
--cmake-generator=Ninja \ | |
--cmake-build-type="${{ matrix.cmake_build_type }}" \ | |
--cmake-definitions="-DLCovCodeCoverageMode=ON" | |
env: | |
CXX: "/usr/bin/${{ matrix.cxx }}" | |
PYTHONPATH: . | |
if: ${{ matrix.cxx == 'g++-11' && matrix.cmake_build_type == 'Release' }} | |
- name: Print .comment section of binary ZenUnitLibraryTests to confirm it was linked with LLD | |
run: readelf --string-dump .comment "${{matrix.cmake_build_type}}/ZenUnitLibraryTests/ZenUnitLibraryTests" | |
- name: Install and run lcov 2.1 then upload to Codecov.io if g++-11 Release | |
run: | | |
mkdir -p lcov_21 | |
wget https://github.com/linux-test-project/lcov/releases/download/v2.1/lcov-2.1.tar.gz --output-document="lcov_21/lcov-2.1.tar.gz" | |
tar xf "lcov_21/lcov-2.1.tar.gz" --strip-components=1 --directory lcov_21 | |
lcov_21/bin/lcov --version | |
lcov_21/bin/lcov --directory . --capture --output-file coverage.info | |
lcov_21/bin/lcov --list coverage.info | |
bash <(curl -s https://codecov.io/bash) -f coverage.info -t ${{ secrets.CODECOV_TOKEN }} || echo "Codecov did not collect coverage reports" | |
if: ${{ matrix.cxx == 'g++-11' && matrix.cmake_build_type == 'Release' }} |