summaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows/boost_toolsets.yml
blob: 8d2b878a0f9868dc070025ea65c90745f4da189d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Boost (toolsets)

on:
  workflow_call:
  workflow_dispatch:

jobs:
  build:
    strategy:
      matrix:
        boost-version:
          - 1.72.0
          - 1.82.0
          - 1.91.0
        toolset:
          - auto
          - clang
          - clang-cl
          - gcc
          - mingw
          - msvc
        os:
          - ubuntu-latest
          - windows-2022
          - windows-2025

        include:
          # Prettier run names.
          - {os: windows-2022, name: Windows 2022}
          - {os: windows-2025, name: Windows 2025}
          - {os: ubuntu-latest, name: Ubuntu}
          # Target platform.
          - {boost-version: 1.72.0, platform: x86}
          - {boost-version: 1.82.0, platform: x64}
          - {boost-version: 1.91.0, platform: x86}
          # Configuration.
          - {boost-version: 1.72.0, configuration: Debug}
          - {boost-version: 1.82.0, configuration: Release}
          - {boost-version: 1.91.0, configuration: RelWithDebInfo}

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

        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-2022, toolset: gcc}
          - {os: windows-2022, toolset: mingw}
          # Boost only supports VS 2026 starting with 1.91, I think.
          - {os: windows-2025, boost-version: 1.72.0}
          - {os: windows-2025, boost-version: 1.82.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.os == 'windows-2025')
                && (matrix.toolset == 'auto'
                    || matrix.toolset == 'clang-cl'
                    || matrix.toolset == 'msvc')
                && matrix.boost-version < '1.82.0'
            )
        }}

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

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

      - name: Clean up PATH
        uses: egor-tensin/cleanup-path@v5
        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@v7
        with:
          python-version: '3.x'

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

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

      - name: Install MinGW
        uses: egor-tensin/setup-mingw@v3
        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: test/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 }}'