name: Continuous Integration on: schedule: - cron: '0 0 * * 2' push: branches: - main pull_request: branches: - main paths: - .github/workflows/ci.yml - "benchmarks/**" - "kiwi/**" - "py/**" - "tests/**" - setup.py - pyproject.toml - CMakeLists.txt jobs: lint: name: Lint runs-on: ubuntu-latest strategy: matrix: python-version: ['3.12'] steps: - uses: actions/checkout@v7 - name: Get history and tags for SCM versioning to work run: | git fetch --prune --unshallow git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r lint_requirements.txt pip install -e . - name: Formatting if: always() run: | ruff format py --check - name: Linting if: always() run: | ruff check py - name: Typing if: always() # We test twice to ensure the type annotations are properly installed run: | mypy py cd py/tests mypy . benchmark: name: C++ Benchmark runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] steps: - uses: actions/checkout@v7 - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y cmake ninja-build g++-11 - name: Configure CMake env: CXX: g++-11 run: | cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release - name: Build benchmark run: | cmake --build build --target kiwi_benchmark - name: Run benchmark run: | ./build/benchmarks/kiwi_benchmark cpp-tests: name: C++ Tests runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] build_type: [Release] steps: - uses: actions/checkout@v7 - name: Install dependencies (Linux) if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y cmake ninja-build - name: Install dependencies (macOS) if: matrix.os == 'macos-latest' run: | brew install cmake ninja - name: Configure CMake run: | cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - name: Build run: | cmake --build build --config ${{ matrix.build_type }} - name: Run tests run: | cd build/tests/ ctest --output-on-failure -C ${{ matrix.build_type }} tests: name: Unit tests runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.10', '3.11', '3.12', '3.13', '3.13t', '3.14', '3.14t', '3.15-dev', '3.15t-dev', 'pypy-3.10', 'pypy-3.11', 'graalpy-25.0'] steps: - uses: actions/checkout@v7 - name: Get history and tags for SCM versioning to work run: | git fetch --prune --unshallow git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - name: Install project env: CPPFLAGS: --coverage run: | pip install . - name: Test with pytest run: | pip install pytest python -X dev -m pytest py -W error - name: Generate C++ coverage reports if: (github.event_name != 'schedule' && matrix.os != 'windows-latest') run: | bash -c "find . -type f -name '*.gcno' -exec gcov -pb --all-blocks {} +" || true - name: Upload coverage to Codecov uses: codecov/codecov-action@v7 if: (github.event_name != 'schedule' && matrix.os != 'windows-latest') with: token: ${{ secrets.CODECOV_TOKEN }} flags: unittests name: codecov-umbrella fail_ci_if_error: true