Add min and max. #112
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: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install scikit-build-core cmake | |
- name: Install lcov | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y lcov | |
- name: Configure and build the C extension | |
run: | | |
mkdir lib | |
# Set environment variables for compiler and linker flags | |
# Build the project | |
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage" \ | |
pip install . --target lib --no-clean -Cbuild-dir=build | |
cmake --build build --target test_incstatspy | |
- name: Install test dependencies | |
run: | | |
python -m pip install numpy pytest | |
- name: Run pytest | |
run: | | |
export PYTHONPATH=$(pwd)/lib | |
pytest test/test_incstatspy.py | |
- name: Generate coverage data | |
run: | | |
export PYTHONPATH=$(pwd)/lib | |
cd build | |
./test_incstatspy ../test/test_incstatspy.py | |
lcov --capture --directory . --directory .. --output-file coverage.info --rc lcov_branch_coverage=1 | |
lcov --remove coverage.info '/usr/*' --output-file coverage.info --rc lcov_branch_coverage=1 | |
lcov --remove coverage.info '/opt/hostedtoolcache/*' --output-file coverage.info --rc lcov_branch_coverage=1 | |
lcov --remove coverage.info '*/numpy/*' --output-file coverage.info --rc lcov_branch_coverage=1 | |
lcov --list coverage.info --rc lcov_branch_coverage=1 | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: build/coverage.info | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
codecov_yml_path: .github/codecov.yml |