diff --git a/.github/composite-actions/download-libraries/action.yml b/.github/composite-actions/download-libraries/action.yml index 72b996ef93..853e0f32ca 100644 --- a/.github/composite-actions/download-libraries/action.yml +++ b/.github/composite-actions/download-libraries/action.yml @@ -11,6 +11,11 @@ inputs: description: 'Download googletest' default: true + install-boost: + type: boolean + description: 'Install boost' + default: true + runs: using: 'composite' steps: @@ -21,17 +26,33 @@ runs: sudo apt-get install gcc-10 g++-10 cmake build-essential -y shell: bash - - name: Install Boost + - name: Make lib directory run: | - sudo add-apt-repository ppa:mhier/libboost-latest - sudo apt update - sudo apt-get install libboost1.81-all-dev -y + mkdir -p lib shell: bash - - name: Make lib directory + - name: Cache Boost + uses: actions/cache@v3 + id: cache-boost + with: + path: ${{github.workspace}}/lib/boost_1_81_0 + key: ${{ runner.os }}-boost-81 + + - name: Download and unpack Boost run: | - mkdir -p lib + cd ${{github.workspace}}/lib + wget -O boost_1_81_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.gz/download + tar xzf boost_1_81_0.tar.gz + shell: bash + if: steps.cache-boost.outputs.cache-hit != 'true' + + - name: Install Boost + run: | + cd lib/boost_1_81_0 + ./bootstrap.sh --prefix=/usr + sudo ./b2 install --prefix=/usr || true shell: bash + if: inputs.install-boost != 'false' - name: Download googletest uses: ./.github/composite-actions/download-library diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 2cc5990888..211781d4ab 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -79,21 +79,7 @@ jobs: with: download-pybind: true download-googletest: false - - - name: Cache unpacked Boost - uses: actions/cache@v3 - id: cache-unpacked-boost - with: - path: ${{github.workspace}}/lib/boost_1_81_0 - key: ${{ runner.os }}-boost-for-wheels-81 - - - name: Download & unpack Boost - run: | - cd ${{github.workspace}}/lib - wget -O boost_1_81_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.gz/download - tar xzf boost_1_81_0.tar.gz - shell: bash - if: steps.cache-unpacked-boost.outputs.cache-hit != 'true' + install-boost: false - name: Build wheels uses: pypa/cibuildwheel@v2.16.2 @@ -101,7 +87,7 @@ jobs: only: ${{ matrix.only }} env: CIBW_BEFORE_ALL: > - cd lib/boost_1_81_0 && + cd lib/boost_1_81_0 && ./bootstrap.sh --prefix=/usr/local && ./b2 install -j4 --prefix=/usr/local CIBW_TEST_COMMAND: >