aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/.github/workflows/boost_toolsets.yml
blob: 52c95bb8d6457b384392a1726c4560cdbc6f7bf5 (plain) (tree)
1
2
3
4
5
6
7



                      


                     








                                                                
             
                                               
                                                          
                                                       


                               
                                                  
                                                  
                                             

                                                  

                                                  

                                                         

                                                              

                                                     

                                                              






                                                                                                                      
                                                       
                                                                    
                
                                     

                                                  



                                                                             
                                            
                                              


                                                                         
                                                      




                                                                                    
                                                                          
                                       
                          
                                        



                                                   







                      
                                 
 
                         
                              

                                                              
                                                  
 
                           
                                         





                                                

                           


                                     



                                      
                                            
                                                                                      



                                        
                                            




                                                                     
                                            































































                                                                              
name: Boost (toolsets)

on:
  push:
    paths:
      - 'examples/**'
      - 'project/**'
  pull_request:
  schedule:
    # Weekly, at 5:30 AM on Saturday (somewhat randomly chosen).
    - cron: '30 5 * * 6'
  workflow_dispatch:

jobs:
  build:
    strategy:
      matrix:
        boost-version: [1.58.0, 1.68.0, 1.78.0]
        toolset: [auto, clang, clang-cl, gcc, mingw, msvc]
        os: [ubuntu-latest, windows-2019, windows-2022]

        include:
          # Prettier run names.
          - {os: windows-2022, name: Windows 2022}
          - {os: windows-2019, name: Windows 2019}
          - {os: ubuntu-latest, name: Ubuntu}
          # Target platform.
          - {boost-version: 1.58.0, platform: x64}
          - {boost-version: 1.68.0, platform: x86}
          - {boost-version: 1.78.0, platform: x64}
          # Configuration.
          - {boost-version: 1.58.0, configuration: Debug}
          - {boost-version: 1.68.0, configuration: MinSizeRel}
          - {boost-version: 1.78.0, configuration: Release}

          # Some Boost libraries commonly used by me.
          - libraries: filesystem program_options regex system

          # On Windows, clang fails to build Boost.Test prior to version 1.61
          # with the following error:
          #
          #     .\boost/test/impl/execution_monitor.ipp:1134:20: error: cannot compile this 'this' captured by SEH yet
          #
          # This was fixed for 1.61 in this commit:
          # https://github.com/boostorg/test/commit/c94ef6982e2ebe77f9376579547c228f0d62e45f.
          # On Linux, everything should be fine though.
          #- libraries: filesystem program_options regex system test
        exclude:
          # Ubuntu: no MSVC/clang-cl.
          - {os: ubuntu-latest, toolset: msvc}
          - {os: ubuntu-latest, toolset: clang-cl}
          # Optimization: MinGW-w64 should be the same on different Windows
          # versions.  Clang on the other hand relies on the Microsoft linker
          # (at least it did at some point), so it makes sense to test it
          # against different Visual Studio versions.
          - {os: windows-2019, toolset: gcc}
          - {os: windows-2019, toolset: mingw}
          # clang-cl is only supported by Boost.Build since 1.69 (see the
          # boost_clang_windows.yml workflow).
          - {toolset: clang-cl, boost-version: 1.58.0}
          - {toolset: clang-cl, boost-version: 1.68.0}

    runs-on: '${{ matrix.os }}'

    name: '${{ matrix.boost-version }} / ${{ matrix.toolset }} / ${{ matrix.name }}'

    # 1) VS 2022 isn't supported by older Boost versions.  It just doesn't
    #    work, the errors are numerous.
    continue-on-error: ${{
            (matrix.os == 'windows-2022'
                && (matrix.toolset == 'auto'
                    || matrix.toolset == 'clang-cl'
                    || matrix.toolset == 'msvc')
                && matrix.boost-version < '1.78.0')
        }}

    defaults:
      run:
        shell: pwsh

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Cache Boost
        uses: actions/cache@v3
        with:
          path: '${{ runner.workspace }}/boost/boost_*.tar.gz'
          key: 'boost_${{ matrix.boost-version }}'

      - name: Clean up PATH
        uses: egor-tensin/cleanup-path@v3
        if: runner.os == 'Windows'

      - name: Set common variables
        uses: ./.github/actions/common-variables
        with:
          toolset: '${{ matrix.toolset }}'

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.x'

      - name: Install GCC
        uses: egor-tensin/setup-gcc@v1
        with:
          platform: '${{ matrix.platform }}'
        if: env.CI_HOST_LINUX && (matrix.toolset == 'auto' || matrix.toolset == 'gcc')

      - name: Install Clang
        uses: egor-tensin/setup-clang@v1
        with:
          platform: '${{ matrix.platform }}'
        if: matrix.toolset == 'clang' || matrix.toolset == 'clang-cl'

      - name: Install MinGW
        uses: egor-tensin/setup-mingw@v2
        with:
          platform: '${{ matrix.platform }}'
        # toolset == 'clang' needs some kind of make, e.g. mingw32-make:
        if: env.CI_MINGW || (matrix.toolset == 'clang' && env.CI_HOST_WINDOWS)

      - name: Set up software environment
        uses: ./.github/actions/software-environment
        with:
          toolset: '${{ matrix.toolset }}'
          platform: '${{ matrix.platform }}'

      - name: Set up Visual Studio
        uses: egor-tensin/vs-shell@v2
        with:
          arch: '${{ matrix.platform }}'
        if: matrix.toolset == 'clang-cl' && env.CI_HOST_WINDOWS

      - name: Download Boost
        uses: ./.github/actions/download-boost
        with:
          boost-version: '${{ matrix.boost-version }}'

      - name: Build Boost
        uses: ./.github/actions/build-boost
        with:
          toolset: '${{ matrix.toolset }}'
          libraries: '${{ matrix.libraries }}'
          platform: '${{ matrix.platform }}'
          configuration: '${{ matrix.configuration }}'
        continue-on-error: true

      - name: Check that Boost was bootstrapped
        uses: ./.github/actions/check-boost-bootstrapped

      - name: Check that Boost libraries were built
        uses: ./.github/actions/check-boost-libraries
        with:
          libraries: '${{ matrix.libraries }}'
          platform: '${{ matrix.platform }}'
          configuration: '${{ matrix.configuration }}'

      - name: Build examples/boost
        id: build_example
        uses: ./.github/actions/build-example
        with:
          src-dir: examples/boost
          boost-dir: '${{ env.BOOST_DIR }}'
          toolset: '${{ matrix.toolset }}'
          platform: '${{ matrix.platform }}'
          configuration: '${{ matrix.configuration }}'

      - name: Verify runtime library linkage
        uses: ./.github/actions/check-runtime-library
        with:
          path: '${{ steps.build_example.outputs.install-dir }}'

      - name: Verify architecture
        uses: ./.github/actions/check-arch
        with:
          path: '${{ steps.build_example.outputs.install-dir }}'
          expected: '${{ matrix.platform }}'

      - name: Run examples/boost
        uses: ./.github/actions/run-example-boost
        with:
          path: '${{ steps.build_example.outputs.install-dir }}'