diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml deleted file mode 100644 index d635401..0000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,83 +0,0 @@ -# ref: https://github.com/actions/runner-images -name: build_and_test - -# Controls when the action will run. -on: - push: - branches: - - master - pull_request: - branches: - - master - workflow_dispatch: - -concurrency: - # Each run on master gets its own group, so that master runs are never - # cancelled and every commit gets a CI result. Setting - # cancel-in-progress to false would not suffice: a new run still cancels - # a pending run in the same group. - group: ${{github.workflow}}-${{github.ref == 'refs/heads/master' && github.run_id || github.ref}} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - unix: - strategy: - fail-fast: false - matrix: - runs-on: [ubuntu-latest] - build_tool: [bazel, cmake] - - name: "script ${{matrix.build_tool}}" - runs-on: ${{matrix.runs-on}} - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - name: Show env - run: env - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v7 - - - name: Setup bazel - if: matrix.build_tool == 'bazel' - uses: bazel-contrib/setup-bazel@0.19.1 - with: - bazelisk-cache: true - disk-cache: ${{ github.workflow }} - repository-cache: true - # Only master saves caches; pull requests restore master's caches - # (by key prefix), so they pay only for what they change, and the - # repository's 10 GB cache storage is not filled with per-PR copies. - cache-save: ${{github.ref == 'refs/heads/master'}} - # Bazel 9 also keeps extracted repositories (e.g. Python toolchains) - # in the repository cache, which grew the saved cache from about - # 0.4 GB to 1.6 GB; restoring that takes longer than re-extracting. - bazelrc: common --repo_contents_cache= - - - name: Show bazel version - if: matrix.build_tool == 'bazel' - run: bazel --version - - - name: Show cmake version - if: matrix.build_tool == 'cmake' - run: cmake --version - - # The runner's system Python is managed by Debian (pip cannot replace its - # packages) and may be newer than the versions with requirements lock - # files, so use a Python from actions/setup-python instead. - - name: Setup Python - uses: actions/setup-python@v7 - with: - python-version: '3.12' - - - name: Show platform info - run: python -m platform - - - name: Install virtualenv - run: python -m pip install virtualenv - - - name: Show nproc - run: echo nproc=$(nproc) - - - name: Build and run tests - run: bash ./scripts/build_and_run_tests_${{matrix.build_tool}}.sh -j $(nproc) diff --git a/.github/workflows/ubuntu-build.yml b/.github/workflows/ubuntu-build.yml deleted file mode 100644 index 3a07cc8..0000000 --- a/.github/workflows/ubuntu-build.yml +++ /dev/null @@ -1,107 +0,0 @@ -# ref: https://github.com/actions/runner-images -name: ubuntu-build - -# Controls when the action will run. -on: - push: - branches: - - master - pull_request: - branches: - - master - workflow_dispatch: - -concurrency: - # Each run on master gets its own group, so that master runs are never - # cancelled and every commit gets a CI result. Setting - # cancel-in-progress to false would not suffice: a new run still cancels - # a pending run in the same group. - group: ci-${{github.workflow}}-${{github.ref == 'refs/heads/master' && github.run_id || github.ref}} - cancel-in-progress: true - -jobs: - cmake: - name: ubuntu-latest cmake - runs-on: ubuntu-latest - steps: - - name: Show env - run: env - - uses: actions/checkout@v7 - - name: Install Build Dependencies - run: > - sudo apt update && - sudo apt install --no-install-recommends -y - cmake make - - name: Show Python version and platform info - run: | - python --version - python -m platform - - name: Show CMake version - run: cmake --version - - name: CMake Configure - run: cmake -S. -Bbuild -DCMAKE_VERBOSE_MAKEFILE=ON - - name: CMake Build - run: cmake --build build -j$(nproc) - - bazel_inner: - strategy: - matrix: - options: [ - {version: 17, flags: "-std=c++17"}, - {version: 20, flags: "-std=c++20"}, - ] - fail-fast: false # Don't cancel all jobs if one fails. - name: bazel c++${{ matrix.options.version }} - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v7 - - name: Setup Python - uses: actions/setup-python@v7 - with: - python-version: 3.11 # Current default version in MODULE.bazel - - name: Show Python version and platform info - run: | - python --version - python -m platform - - uses: bazel-contrib/setup-bazel@0.19.1 - with: - bazelisk-cache: true - # One disk cache per C++ standard: a cache is written once per key, - # and C++17 and C++20 builds do not share compile actions. - disk-cache: ${{ github.workflow }}-cxx${{ matrix.options.version }} - repository-cache: true - # Only master saves caches; pull requests restore master's caches - # (by key prefix), so they pay only for what they change, and the - # repository's 10 GB cache storage is not filled with per-PR copies. - cache-save: ${{github.ref == 'refs/heads/master'}} - # Bazel 9 also keeps extracted repositories (e.g. Python toolchains) - # in the repository cache, which grew the saved cache from about - # 0.4 GB to 1.6 GB; restoring that takes longer than re-extracting. - bazelrc: common --repo_contents_cache= - - name: Show Bazel version - run: bazel --version - - name: Bazel Build - shell: bash - run: > - bazel build - --config=ci - --cxxopt=${{ matrix.options.flags }} --host_cxxopt=${{ matrix.options.flags }} - --subcommands=pretty_print - --enable_bzlmod - //... - - name: Bazel Test - shell: bash - run: > - bazel test - --config=ci - --cxxopt=${{ matrix.options.flags }} --host_cxxopt=${{ matrix.options.flags }} - --subcommands=pretty_print - --enable_bzlmod - //... - - bazel: - name: ubuntu-latest bazel - runs-on: ubuntu-latest - needs: bazel_inner - steps: - - uses: actions/checkout@v7 diff --git a/pybind11_abseil/scripts/build_and_run_tests_bazel.sh b/pybind11_abseil/scripts/build_and_run_tests_bazel.sh deleted file mode 100755 index 0fe2d4e..0000000 --- a/pybind11_abseil/scripts/build_and_run_tests_bazel.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# The following script builds and runs tests - -set -e # exit when any command fails -set -x # Prints all executed commands - -MYDIR="$(dirname "$(realpath "$0")")" - -BAZEL=$(which bazel || true) -if [[ -z $BAZEL || ! -x $BAZEL ]] -then - echo -e -n '\e[1m\e[93m' - echo -n 'Bazel not found (bazel (https://bazel.build/) is needed to ' - echo -n 'compile & test). ' - echo -e 'Exiting...\e[0m' - exit 1 -fi - -echo "Building and testing in $PWD using 'python' (version $PYVERSION)." - -bazel clean --expunge # Force a deep update - -# Can't use BAZEL_CXXOPTS since it will be override by the bazelrc cxxopt need -# to use --cxxopt on the command line instead which will override the bazelrc -# cxxopt config. -bazel test --cxxopt=-std=c++17 ... --test_output=errors "$@" --enable_bzlmod -bazel test --cxxopt=-std=c++20 ... --test_output=errors "$@" --enable_bzlmod diff --git a/pybind11_abseil/scripts/build_and_run_tests_cmake.sh b/pybind11_abseil/scripts/build_and_run_tests_cmake.sh deleted file mode 100755 index b6dc855..0000000 --- a/pybind11_abseil/scripts/build_and_run_tests_cmake.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash - -# The following scripts: -# - creates a virtualenv -# - installs the pip package dependencies -# - builds and runs tests - -set -e # exit when any command fails -set -x # Prints all executed commands - -MYDIR="$(dirname "$(realpath "$0")")" - -CMAKE=$(which cmake || true) -if [[ -z $CMAKE || ! -x $CMAKE ]] -then - echo -e -n '\e[1m\e[93m' - echo -n 'CMake not found (cmake is needed to ' - echo -n 'compile & test). ' - echo -e 'Exiting...\e[0m' - exit 1 -fi - -VIRTUAL_ENV_BINARY=$(which virtualenv || true) -if [[ -z $VIRTUAL_ENV_BINARY || ! -x $VIRTUAL_ENV_BINARY ]] -then - echo -e -n '\e[1m\e[93m' - echo -n 'virtualenv command not found ' - echo -n '(try `python3 -m pip install virtualenv`, possibly as root). ' - echo -e 'Exiting...\e[0m' - exit 1 -fi - -is_in_virtual_env="false" -# if we are in a virtual_env, we will not create a new one inside. -if [[ "$VIRTUAL_ENV" != "" ]] -then - echo -e "\e[1m\e[93mVirtualenv already detected. We do not create a new one.\e[0m" - is_in_virtual_env="true" -fi - -echo -e "\e[33mRunning ${0} from $PWD\e[0m" -PYBIN=$(which python3 || true) -if [[ -z $PYBIN || ! -x $PYBIN ]] -then - echo -e '\e[1m\e[93mpython3 not found! Skip build and test.\e[0m' - exit 1 -fi - -PYVERSION=$($PYBIN -c 'import sys; print(".".join(map(str, sys.version_info[:3])))') - -VENV_DIR="./venv" - -if [[ $is_in_virtual_env == "false" ]]; then - if ! [ -d "$VENV_DIR" ]; then - echo "Installing..." - echo -e "\e[33mInstalling a virtualenv to $VENV_DIR. The setup is long the first time, please wait.\e[0m" - virtualenv -p "$PYBIN" "$VENV_DIR" - else - echo -e "\e[33mReusing virtualenv from $VENV_DIR.\e[0m" - fi - source "${VENV_DIR}/bin/activate" -fi - -# We only exit the virtualenv if we created one. -function cleanup { - if [[ $is_in_virtual_env == "true" ]]; then - echo "Exiting virtualenv" - deactivate - fi -} -trap cleanup EXIT - -echo -e "\e[33mInstalling the requirements (use --noinstall to skip).\e[0m" -pip3 install --upgrade -r $(python3 -c 'import sys; print("./pybind11_abseil/requirements/requirements_lock_%d_%d.txt" % (sys.version_info[:2]))') - -echo "Building and testing in $PWD using 'python' (version $PYVERSION)." - -PYTHON_BIN_PATH="$(which python3)" -export PYTHON_BIN_PATH -PYTHON_LIB_PATH=$(python3 -c "import sysconfig; print(sysconfig.get_path('include'))") -export PYTHON_LIB_PATH -echo "Using PYTHON_BIN_PATH: $PYTHON_BIN_PATH" -echo "Using PYTHON_LIB_PATH: $PYTHON_LIB_PATH" - -if [ -e tmp_build ]; then - rm -r tmp_build -fi - -mkdir tmp_build -cd tmp_build - -# C++17 -cmake ../ -DCMAKE_CXX_STANDARD=17 -DCMAKE_VERBOSE_MAKEFILE=ON -make "$@" -ctest --output-on-failure --extra-verbose - -rm -r ./* - -# C++20 -cmake ../ -DCMAKE_CXX_STANDARD=20 -DCMAKE_VERBOSE_MAKEFILE=ON -make "$@" -ctest --output-on-failure --extra-verbose - -cd ../ -rm -r tmp_build