diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-auto.yml similarity index 60% rename from .github/workflows/ci.yml rename to .github/workflows/ci-auto.yml index f75b2dde6..90c5f725a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-auto.yml @@ -1,4 +1,4 @@ -name: ci +name: ci auto on: push: @@ -12,5 +12,6 @@ jobs: ci: uses: ./.github/workflows/common.yml with: - python-version: '3.7' - os: ubuntu-20.04 + python-version: "3.7" + os: "ubuntu-20.04" + cmake-version: "3.16.x" diff --git a/.github/workflows/ci-manual.yml b/.github/workflows/ci-manual.yml new file mode 100644 index 000000000..cd5f8d629 --- /dev/null +++ b/.github/workflows/ci-manual.yml @@ -0,0 +1,41 @@ +name: ci manual + +on: + workflow_dispatch: + inputs: + fail-fast: + description: 'Fail the build after single job fails' + required: true + default: false + type: boolean + os: + description: 'JSON array of OS to be checked' + required: true + default: "[\"ubuntu-20.04\", \"ubuntu-22.04\", \"macos-11\", \"macos-12\", \"macos-13\"]" + type: string + python-version: + description: 'JSON array of Python versions to be checked' + required: true + default: "[\"3.7\", \"3.8\", \"3.9\", \"3.10\", \"3.11\"]" + type: string + cmake-version: + description: 'JSON array of CMake versions to be checked' + required: true + default: "[\"3.15.x\"]" + type: string + +jobs: + build: + strategy: + fail-fast: ${{ inputs.fail-fast }} + matrix: + os: ${{ fromJson(inputs.os) }} + python-version: ${{ fromJson(inputs.python-version) }} + cmake-version: ${{ fromJson(inputs.cmake-version) }} + max-parallel: 5 + + uses: ./.github/workflows/common.yml + with: + os: ${{ matrix.os }} + python-version: ${{ matrix.python-version }} + cmake-version: ${{ matrix.cmake-version }} diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index cf1940049..2acdc7a01 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -19,6 +19,11 @@ on: default: ubuntu-20.04 required: false type: string + cmake-version: + description: 'CMake version to use' + default: 3.16.x + required: false + type: string jobs: run: @@ -34,32 +39,63 @@ jobs: toolchain: stable override: true - - name: Build and test + - name: Build Rust library working-directory: ./lib run: | cargo check cargo build + + - name: Test Rust library + working-directory: ./lib + run: | RUST_LOG=hyperon=debug cargo test + - name: Install cbindgen + uses: actions-rs/cargo@v1.0.1 + with: + command: install + args: cbindgen + - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ inputs.python-version }} + - name: Install CMake + uses: jwlawson/actions-setup-cmake@v1.14.1 + with: + cmake-version: ${{ inputs.cmake-version }} + - name: Install Conan uses: turtlebrowser/get-conan@v1.2 with: - version: 1.60.1 + version: 1.60.2 - - name: Install cbindgen - uses: actions-rs/cargo@v1.0.1 - with: - command: install - args: cbindgen + - name: Setup Conan profile + run: | + conan profile new --detect default + + - name: Print environment + run: | + echo "rustc --version" + rustc --version + echo "cbindgen --version" + cbindgen --version + echo "python --version" + python --version + echo "conan --version" + conan --version + echo "conan profile show default" + conan profile show default + echo "gcc --version" + gcc --version + echo "cmake --version" + cmake --version + echo "make --version" + make --version - name: Setup C API build run: | - conan profile new --detect default mkdir -p build cd build # specify C compiler as conan could not find it automatically diff --git a/CMakeLists.txt b/CMakeLists.txt index c3e41687a..f040c1d4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -# minimum version required by $ generator expression -cmake_minimum_required(VERSION 3.10.2) +# Minimal version supported by hyperonc +cmake_minimum_required(VERSION 3.15) project(hyperon) @@ -43,5 +43,5 @@ message(STATUS "HYPERONPY_BINARY_DIR = ${HYPERONPY_BINARY_DIR}") enable_testing() add_custom_target(check - COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure --test-dir "${HYPERONC_BINARY_DIR}" - COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure --test-dir "${HYPERONPY_BINARY_DIR}") + COMMAND cd "${HYPERONC_BINARY_DIR}" && ${CMAKE_CTEST_COMMAND} --no-tests=error --output-on-failure + COMMAND cd "${HYPERONPY_BINARY_DIR}" && ${CMAKE_CTEST_COMMAND} --no-tests=error --output-on-failure) diff --git a/Dockerfile b/Dockerfile index 187c2923f..a15e5fe34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN sh /tmp/rustup.sh -y && rm /tmp/rustup.sh ENV PATH="${PATH}:/home/user/.cargo/bin" RUN cargo install cbindgen -RUN python3 -m pip install conan==1.60.1 pip==23.1.2 +RUN python3 -m pip install conan==1.60.2 pip==23.1.2 ENV PATH="${PATH}:/home/user/.local/bin" RUN conan profile new --detect default diff --git a/README.md b/README.md index 8c9557f34..aa6ea62f9 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Rust (see the Notes at the installation page). * Python3 and Python3-dev (3.7 or later) * Pip (23.1.2 or later) * GCC (7.5 or later) - * CMake (3.10 or later) + * CMake (3.15 or later) * Install cbindgen: ``` @@ -59,7 +59,7 @@ cargo install --force cbindgen * Install Conan and make default Conan profile: ``` -python3 -m pip install conan==1.60.1 +python3 -m pip install conan==1.60.2 conan profile new --detect default ``` diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt index dd3ae55fa..b80568e77 100644 --- a/c/CMakeLists.txt +++ b/c/CMakeLists.txt @@ -1,5 +1,5 @@ -# minimum version required by $ generator expression -cmake_minimum_required(VERSION 3.10.2) +# Minimal version which allows building dependencies from sources +cmake_minimum_required(VERSION 3.15) project(hyperonc) enable_testing() @@ -9,7 +9,7 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure) execute_process( # --build is required to build dependencies from source under cibuildwheel # environment - COMMAND conan install --build -- ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND cmake -E env CC= CXX= conan install --build -- ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) diff --git a/python/install-hyperonc.sh b/python/install-hyperonc.sh index 3091f8d81..487c2cc91 100755 --- a/python/install-hyperonc.sh +++ b/python/install-hyperonc.sh @@ -30,7 +30,7 @@ sh /tmp/rustup.sh -y && rm /tmp/rustup.sh export PATH="${PATH}:${HOME}/.cargo/bin" cargo install cbindgen -python3 -m pip install conan==1.60.1 pip==23.1.2 +python3 -m pip install conan==1.60.2 pip==23.1.2 PATH="${PATH}:${HOME}/.local/bin" conan profile new --detect default diff --git a/python/pyproject.toml b/python/pyproject.toml index 892b7b12c..4c3f61ace 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools==65.6.3", "conan==1.60.1", "cmake==3.26.4"] +requires = ["setuptools==65.6.3", "conan==1.60.2", "cmake==3.26.4"] build-backend = "setuptools.build_meta" [project]