Skip to content

Make having pytest mandatory only if PYTHON_TEST_FORCE is set in CMake #567

Make having pytest mandatory only if PYTHON_TEST_FORCE is set in CMake

Make having pytest mandatory only if PYTHON_TEST_FORCE is set in CMake #567

Workflow file for this run

name: Coverage
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: "Coverage"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Get Concurrency
run: echo NPROC="nproc" >> $GITHUB_ENV
- name: Set Up Dependencies
run: |
sudo apt install -y cmake ninja-build pkg-config lcov g++-11 libcairo2-dev gnuplot libmpfr-dev python3-pip python3.11-dev gnuplot
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
sudo pip3 install coverage pytest
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++-11 -G "Ninja" -DCOVERAGE=ON -DPYTHON_TEST_FORCE=ON
- name: Build Library, Bindings and Tests
working-directory: ${{runner.workspace}}/build
run: cmake --build . --parallel $($NPROC) --target pyariadne tests
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -j $($NPROC) --output-on-failure
- name: Generate Code Coverage
working-directory: ${{runner.workspace}}/ariadne
run: |
lcov --directory ${{runner.workspace}}/build --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --list coverage.info
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"