Skip to content

Update actions/checkout@v3 to actions/checkout@v4 #212

Update actions/checkout@v3 to actions/checkout@v4

Update actions/checkout@v3 to actions/checkout@v4 #212

Workflow file for this run

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@v4
with:
python-version: '3.11'
- uses: actions/cache@v3
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 if g++-11 Release
run: sudo apt-get install lcov
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@v3
with:
files: ZenUnitDevOpsPythonTests/CoberturaCodeCoverageResults_ZenUnitDevOpsPythonTests.xml
fail_ci_if_error: true
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 1.15 then upload to Codecov.io if g++-11 Release
run: |
mkdir -p lcov_1_15
wget https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15.tar.gz --output-document="lcov_1_15/lcov-1.15.tar.gz"
tar xf "lcov_1_15/lcov-1.15.tar.gz" --strip-components=1 --directory lcov_1_15
lcov_1_15/bin/lcov --version
lcov_1_15/bin/lcov --directory . --capture --output-file coverage.info
lcov_1_15/bin/lcov --list coverage.info
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
if: ${{ matrix.cxx == 'g++-11' && matrix.cmake_build_type == 'Release' }}
- name: SonarCloud scan if g++-11 Release
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
if: ${{ matrix.cxx == 'g++-11' && matrix.cmake_build_type == 'Release' }}