aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 9ec1b2ed13d5975450f009006d86f840866c6b6f (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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
name: CI

on:
  pull_request:
  push:
    branches:
      - master
      - develop
      - feature/**
    tags:
      - '**'

jobs:
  b2-posix:
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
          - os: ubuntu-24.04-arm
          - os: macos-latest

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

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Setup Boost
        run: |
          ./bootstrap.sh
          ./b2 -d0 headers

      - name: Build Boost
        run: |
          ./b2 -j3 stage

      - name: Install Boost
        run: |
          ./b2 -j3 --prefix=$HOME/.local install

      - name: Test Boost
        run: |
          cd status
          ../b2 -j3 quick

  b2-windows:
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: windows-latest

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

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Setup Boost
        shell: cmd
        run: |
          cmd /c bootstrap
          b2 -d0 headers

      - name: Build Boost
        run: |
          ./b2 -j3 stage

      - name: Install Boost
        run: |
          ./b2 -j3 install

      - name: Test Boost
        run: |
          cd status
          ../b2 -j3 quick

  b2-check-installed-posix:
    runs-on: ubuntu-26.04

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Install Boost
        run: |
          ./bootstrap.sh
          ./b2 -j3 --prefix=$HOME/.local install

      - name: Test installed headers
        run: |
          g++ -I ~/.local/include -I /usr/include/python3.14 -std=c++20 -c tools/boost_install/test/headers/include.cpp

      - name: Check installed files
        run: |
          file -E ~/.local/share/boost_predef/build.jam
          file -E ~/.local/lib/cmake/BoostDetectToolset-*.cmake
          file -E ~/.local/lib/cmake/Boost-*/BoostConfig.cmake
          file -E ~/.local/lib/cmake/Boost-*/BoostConfigVersion.cmake
          file -E ~/.local/lib/cmake/boost_headers-*/boost_headers-config.cmake
          file -E ~/.local/lib/cmake/boost_headers-*/boost_headers-config-version.cmake
          file -E ~/.local/lib/cmake/boost_system-*/boost_system-config.cmake
          file -E ~/.local/lib/cmake/boost_system-*/boost_system-config-version.cmake

  b2-cmake-tool-posix:
    strategy:
      fail-fast: false
      matrix:
        tool:
          - boostdep
          - inspect
          - quickbook

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Install Boost
        run: |
          ./bootstrap.sh
          ./b2 -j3 --prefix=$HOME/.local --with-filesystem --with-regex --with-program_options install

      - name: Build tool with CMake
        run: |
          cmake -S tools/${{matrix.tool}} -B __build__ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local
          cmake --build __build__ --target install

  b2-cmake-tool-windows:
    strategy:
      fail-fast: false
      matrix:
        tool:
          - boostdep
          - inspect
          - quickbook

    runs-on: windows-latest

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Install Boost
        shell: cmd
        run: |
          cmd /c bootstrap
          b2 -j3 --with-filesystem --with-regex --with-program_options install

      - name: Build tool with CMake
        run: |
          cmake -S tools/${{matrix.tool}} -B __build__ -DBoost_ROOT=C:/Boost -DCMAKE_INSTALL_PREFIX=C:/usr/local
          cmake --build __build__ --target install --config Release

  b2-cmake-use-lib-posix:
    strategy:
      fail-fast: false
      matrix:
        lib:
          - atomic
          - container
          - date_time
          - filesystem
          - headers
          - log
          - program_options
          - python
          - random
          - regex
          - serialization
          - system
          - test
          - thread
          - wave

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Install Boost --with-library
        run: |
          ./bootstrap.sh
          ./b2 -j3 --prefix=$HOME/.local --with-${{matrix.lib}} install

      - name: Use library from CMake
        run: |
          cmake -S tools/boost_install/test/${{matrix.lib}} -B __build__ -DCMAKE_INSTALL_PREFIX=~/.local
          cmake --build __build__
          export LD_LIBRARY_PATH=$HOME/.local/lib:$LD_LIBRARY_PATH
          cmake --build __build__ --target check

  cmake-install-posix:
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
          - os: ubuntu-24.04-arm
          - os: macos-latest

    runs-on: ${{matrix.os}}
    timeout-minutes: 20

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Configure Boost
        run: |
          mkdir __build__ && cd __build__
          cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=~/.local ..

      - name: Build Boost
        run: |
          cd __build__
          cmake --build . -j 3

      - name: Install Boost
        run: |
          cd __build__
          cmake --build . -j 3 --target install

  cmake-install-windows:
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: windows-latest

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

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Configure Boost
        run: |
          mkdir __build__ && cd __build__
          cmake -DBUILD_SHARED_LIBS=ON ..

      - name: Build Boost
        run: |
          cd __build__
          cmake --build . -j 3

      - name: Install Boost
        run: |
          cd __build__
          cmake --build . -j 3 --target install

  cmake-test-posix:
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest

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

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Configure Boost
        run: |
          mkdir __build__ && cd __build__
          cmake -DBUILD_TESTING=ON -DBOOST_EXCLUDE_LIBRARIES="process;geometry" ..

      - name: Build tests
        run: |
          cd __build__
          cmake --build . -j 3 --target tests

      - name: Run tests
        run: |
          cd __build__
          ctest --output-on-failure --no-tests=error -j 3

  cmake-test-posix-quick:
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
          - os: ubuntu-24.04-arm
          - os: macos-latest

    runs-on: ${{matrix.os}}
    timeout-minutes: 90

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Configure Boost
        run: |
          mkdir __build__ && cd __build__
          cmake -DBUILD_TESTING=ON ..

      - name: Build tests
        run: |
          cd __build__
          cmake --build . -j 3 --target tests-quick

      - name: Run tests
        run: |
          cd __build__
          ctest --output-on-failure --no-tests=error -j 3 -R quick

  cmake-test-windows-quick:
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: windows-latest

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

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Configure Boost
        run: |
          mkdir __build__ && cd __build__
          cmake -DBUILD_TESTING=ON ..

      - name: Build tests
        run: |
          cd __build__
          cmake --build . -j 3 --target tests-quick

      - name: Run tests
        run: |
          cd __build__
          ctest --output-on-failure --no-tests=error -j 3 -R quick -C Debug

  # setup windows-11-arm as it is new and does not have all requirements pre-installed.
  setup-windows-arm64:
    runs-on: windows-11-arm
    outputs:
      vcpkg-root: ${{ steps.set-vcpkg-root.outputs.vcpkg-root }}

    steps:
      - uses: actions/checkout@v7

      - name: Install vcpkg
        run: |
          if (!(Test-Path C:\vcpkg)) {
            git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
            C:\vcpkg\bootstrap-vcpkg.bat
          }
          else {
             echo "vcpkg already installed"
          }

      - name: Restore vcpkg cache
        id: cache-vcpkg
        uses: actions/cache@v6
        with:
          path: |
            C:\vcpkg\downloads
            C:\vcpkg\installed
          key: vcpkg-${{ runner.os }}-arm64
          restore-keys: |
            vcpkg-${{ runner.os }}-arm64

      - name: Install OpenSSL via vcpkg (if not cached)
        if: steps.cache-vcpkg.outputs.cache-hit != 'true'
        run: |
          C:\vcpkg\vcpkg install openssl:arm64-windows

      - name: Set vcpkg-root output
        id: set-vcpkg-root
        shell: pwsh
        run: |
          echo "Writing vcpkg-root=C:\vcpkg to GITHUB_OUTPUT"
          echo "vcpkg-root=C:\vcpkg" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append

      - name: Log step output
        run: |
          echo "Step output is: ${{ steps.set-vcpkg-root.outputs.vcpkg-root }}"


  b2-windows-arm64:
    needs: setup-windows-arm64
    runs-on: windows-11-arm
    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Setup Boost
        shell: cmd
        run: |
          bootstrap
          b2 -d0 headers

      # There is no mpi support yet for Windows arm64. So built without mpi for now
      # pch needs to be turned off, otherwise few components fail.
      # It requires additional parameters to be pass for selecting correct asm files for boost:context
      - name: Build Boost
        run: ./b2 -j2 toolset=msvc architecture=arm address-model=64 abi=ms pch=off --without-mpi --without-graph_parallel stage

      - name: Install Boost
        run: ./b2 -j2 toolset=msvc architecture=arm address-model=64 abi=ms pch=off --without-mpi --without-graph_parallel install

      - name: Test Boost
        run: |
          cd status
          ../b2 -j3 pch=off quick

  # Win Arm64 CMake job
  cmake-install-windows-arm64:
    needs: setup-windows-arm64
    runs-on: windows-11-arm

    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      - name: Restore vcpkg cache
        uses: actions/cache@v6
        with:
          path: |
            C:\vcpkg\downloads
            C:\vcpkg\installed
          key: vcpkg-${{ runner.os }}-arm64

      # We are using vcpkg to install dependencies such as OpenSSL in  windows-11-arm runner.
      - name: Configure Boost
        run: |
          mkdir __build__ && cd __build__
          $vcpkgRoot="${{ needs.setup-windows-arm64.outputs.vcpkg-root }}"
          cmake -DBUILD_SHARED_LIBS=ON `
                -DCMAKE_TOOLCHAIN_FILE="$vcpkgRoot\scripts\buildsystems\vcpkg.cmake" `
                -DVCPKG_TARGET_TRIPLET=arm64-windows ..

      - name: Build Boost
        run: |
          cd __build__
          cmake --build . -j 3

      - name: Install Boost
        run: |
          cd __build__
          cmake --build . -j 3 --target install

  # Win Arm64 CMake test job
  cmake-test-windows-arm64-quick:
    needs: setup-windows-arm64
    runs-on: windows-11-arm
    steps:
      - uses: actions/checkout@v7
        with:
          submodules: true

      # Restore cache
      - uses: actions/cache@v6
        with:
          path: |
            C:\vcpkg\downloads
            C:\vcpkg\installed
          key: vcpkg-${{ runner.os }}-arm64

      # we are using vcpkg to install OpenSSL in  windows-11-arm runner.
      - name: Configure Boost
        run: |
          mkdir __build__; cd __build__
          $vcpkgRoot="${{ needs.setup-windows-arm64.outputs.vcpkg-root }}"
          cmake -DBUILD_TESTING=ON -DCMAKE_TOOLCHAIN_FILE="$vcpkgRoot\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=arm64-windows ..

      - name: Build tests
        run: |
          cd __build__
          cmake --build . -j2 --target tests-quick

      - name: Run tests
        run: |
          cd __build__
          ctest --output-on-failure --no-tests=error -j2 -R quick -C Debug