diff --git a/.github/composite-actions/download-libraries/action.yml b/.github/composite-actions/install-dependencies/action.yml similarity index 71% rename from .github/composite-actions/download-libraries/action.yml rename to .github/composite-actions/install-dependencies/action.yml index 2ca8ed1625..6d37bb9263 100644 --- a/.github/composite-actions/download-libraries/action.yml +++ b/.github/composite-actions/install-dependencies/action.yml @@ -1,5 +1,5 @@ -name: 'Download libraries' -description: 'Download files necessary for compilation and testing' +name: 'Install dependencies' +description: 'Download and install build system and libraries' inputs: download-pybind: type: boolean @@ -11,53 +11,67 @@ inputs: description: 'Download googletest' default: true - install-boost-gcc: - type: boolean - description: 'Install boost built with GCC' - default: true - - install-boost-clang: - type: boolean - description: 'Install boost built with clang' - default: false + install-build-tools: + type: choice + options: + none + apt + brew + default: none - install-boost-brew-clang: - type: boolean - description: 'Install boost built with Homebrew Clang' - default: false - - install-gcc: - type: boolean - description: 'Install GCC toolset (compiler and build tools)' - default: true + install-toolset: + type: choice + options: + none + gcc + clang-linux + llvm-clang-macos + default: none - install-clang: - type: boolean - description: 'Install clang toolset (compiler and build tools)' - default: false + install-boost: + type: choice + options: + none + gcc + clang-linux + llvm-clang-macos + apple-clang + default: none runs: using: 'composite' steps: - uses: actions/checkout@v3 - - name: Install build tools + + - name: Install build tools using apt run: | sudo apt-get update -y - sudo apt-get install gcc-10 g++-10 cmake build-essential -y + sudo apt-get install cmake build-essential -y shell: bash - if: inputs.install-gcc != 'false' + if: inputs.install-build-tools == apt + - name: Install build tools using brew + run: brew install make cmake + shell: bash + if: inputs.install-build-tools == brew - - name: Install clang - # llvm.sh installs all needed libraries, no need in build-essential + - name: Install GCC toolset + run: | + sudo apt-get install gcc-10 g++-10 -y + shell: bash + if: inputs.install-toolset == gcc + - name: Install Clang toolset (on Linux) # "all" option is needed to install libc++ and libc++abi + # apt is hardcoded in llvm.sh, so we can't use it everywhere run: | - sudo apt-get update -y - sudo apt-get install cmake make -y wget https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 17 all shell: bash - if: inputs.install-clang != 'false' + if: inputs.install-toolset == clang-linux + - names: Install LLVM Clang toolset (on macOS) + run: brew install llvm@17 + shell: bash + if: inputs.install-toolset == llvm-clang-macos - name: Make lib directory run: | @@ -111,8 +125,8 @@ runs: ./bootstrap.sh --prefix=/usr sudo ./b2 install --prefix=/usr shell: bash - if: inputs.install-boost-gcc != 'false' - - name: Install Boost built with clang + if: inputs.install-boost == gcc + - name: Install Boost built with Clang (on Linux) run: | cd lib/boost ./bootstrap.sh --prefix=/usr --with-toolset=clang @@ -120,8 +134,8 @@ runs: ./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" sudo ./b2 install --prefix=/usr shell: bash - if: inputs.install-boost-clang != 'false' - - name: Install Boost built with Homebrew Clang + if: inputs.install-boost == clang-linux + - name: Install Boost built with LLVM Clang (on macOS) # b2 doesn't recognize custom compilers, so some trick is needed: # Also, /usr is read-only, so install into /usr/local run: | @@ -132,7 +146,12 @@ runs: ./b2 toolset=clang cxxflags="-std=c++11 -stdlib=libc++" linkflags="-stdlib=libc++" sudo ./b2 install --prefix=/usr/local shell: bash - if: inputs.install-boost-brew-clang != 'false' + if: inputs.install-boost == llvm-clang-macos + - name: Install Boost built with Apple Clang + run: brew install boost + shell: bash + if: inputs.install-boost == apple-clang + - name: Download frozen uses: ./.github/composite-actions/download-library with: diff --git a/.github/workflows/bindings-tests.yml b/.github/workflows/bindings-tests.yml index 7f60254a29..bf50e1b2e2 100644 --- a/.github/workflows/bindings-tests.yml +++ b/.github/workflows/bindings-tests.yml @@ -33,9 +33,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Download libraries - uses: ./.github/composite-actions/download-libraries + - name: Install dependencies + uses: ./.github/composite-actions/install-dependencies with: + # FIXME(senichenkiov): Do we need build-tools, gcc and boost here? + install-build-tools: apt + install-toolset: gcc + install-boost: gcc download-pybind: true download-googletest: false - name: Build pip package diff --git a/.github/workflows/check-codestyle.yml b/.github/workflows/check-codestyle.yml index 67d79e43e9..253a5dc73c 100644 --- a/.github/workflows/check-codestyle.yml +++ b/.github/workflows/check-codestyle.yml @@ -49,9 +49,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Download libraries - uses: ./.github/composite-actions/download-libraries + - name: Install dependencies + uses: ./.github/composite-actions/install-dependencies with: + # FIXME(senichenkov): do we need gcc and boost here, or build-tools will be enough? + install-build-tools: apt + install-toolset: gcc + install-boost: gcc download-pybind: true - name: Generate compile_commands.json run: | diff --git a/.github/workflows/core-tests.yml b/.github/workflows/core-tests.yml index 517c390d9a..b1526941bf 100644 --- a/.github/workflows/core-tests.yml +++ b/.github/workflows/core-tests.yml @@ -38,8 +38,13 @@ jobs: - { BUILD_TYPE: Debug, SANITIZER : UB } steps: - uses: actions/checkout@v3 - - name: Download libraries - uses: ./.github/composite-actions/download-libraries + - name: Install dependencies + uses: ./.github/composite-actions/install-dependencies + with: + # TODO(senichenkov): now, we must use matrix here + install-build-tools: apt + install-toolset: gcc + install-boost: gcc - name: Download datasets uses: ./.github/composite-actions/download-datasets - name: Build @@ -66,13 +71,12 @@ jobs: - { BUILD_TYPE: Debug, SANITIZER : UB } steps: - uses: actions/checkout@v3 - - name: Download libraries - uses: ./.github/composite-actions/download-libraries + - name: Install dependencies + uses: ./.github/composite-actions/install-dependencies with: - install-gcc: false - install-clang: true - install-boost-gcc: false - install-boost-clang: true + install-build-tools: apt + install-toolset: clang-linux + install-boost: clang-linux - name: Download datasets uses: ./.github/composite-actions/download-datasets - name: Build @@ -101,17 +105,12 @@ jobs: - { BUILD_TYPE: Debug, SANITIZER : UB } steps: - uses: actions/checkout@v3 - - name: Download build system - run: brew install llvm@17 make - shell: bash - - name: Download libraries - uses: ./.github/composite-actions/download-libraries + - name: Install dependencies + uses: ./.github/composite-actions/install-dependencies with: - install-gcc: false - install-clang: false - install-boost-gcc: false - install-boost-clang: false - install-boost-brew-clang: true + install-build-tools: brew + install-toolset: llvm-clang-macos + install-boost: llvm-clang-macos - name: Download datasets uses: ./.github/composite-actions/download-datasets - name: Build @@ -142,8 +141,13 @@ jobs: - name: Download libraries run: brew install make boost cmake shell: bash - - name: Download datasets - uses: ./.github/composite-actions/download-datasets + - name: Install dependencies + uses: ./.github/composite-actions/install-dependencies + with: + install-build-tools: brew + # Apple Clang is already installed + install-toolset: none + install-boost: apple-clang - name: Build run: | if [[ "${{matrix.cfg.BUILD_TYPE}}" == "Debug" ]]; then diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 712d1206c0..b4252ae261 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -70,12 +70,14 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Download libraries - uses: ./.github/composite-actions/download-libraries + - name: Install dependencies + uses: ./.github/composite-actions/install-dependencies with: + install-build-tools: apt + install-toolset: gcc + install-boost: none download-pybind: true download-googletest: false - install-boost-gcc: false - name: Build wheels uses: pypa/cibuildwheel@v2.16.2