# Copyright 2020 Evan Miller
# Copyright 2020 Matt Borland
# Copyright 2021 John Maddock
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

name: CI
on:
  push:
    branches:
      - master
      - develop
  pull_request:
  release:
    types: [published, created, edited]
jobs:
  ubuntu-24_04:
    runs-on: ubuntu-24.04
    strategy:
      fail-fast: false
      matrix:
        compiler: [ g++-12, g++-13, clang++-15, clang++-16, clang++-17, clang++-18 ]
        standard: [ c++03, c++11, c++14, c++17, c++2a, gnu++03, gnu++11, gnu++14, gnu++17, gnu++2a ]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - uses: mstachniuk/ci-skip@v1
        with:
          commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
          commit-filter-separator: ';'
          fail-fast: true
      - name: Set TOOLSET
        run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
      - name: Add repository
        continue-on-error: true
        id: addrepo
        run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
      - name: Retry Add Repo
        continue-on-error: true
        id: retry1
        if: steps.addrepo.outcome=='failure'
        run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
      - name: Retry Add Repo 2
        continue-on-error: true
        id: retry2
        if: steps.retry1.outcome=='failure'
        run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
      - name: Install packages
        run: sudo apt install g++-12 g++-13 clang-15 clang-16 clang-17 clang-18
      - name: Checkout main boost
        run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
      - name: Update tools/boostdep
        run: git submodule update --init tools/boostdep
        working-directory: ../boost-root
      - name: Copy files
        run: cp -r $GITHUB_WORKSPACE/* libs/type_traits
        working-directory: ../boost-root
      - name: Install deps
        run: python tools/boostdep/depinst/depinst.py type_traits
        working-directory: ../boost-root
      - name: Bootstrap
        run: ./bootstrap.sh
        working-directory: ../boost-root
      - name: Generate headers
        run: ./b2 headers
        working-directory: ../boost-root
      - name: Generate user config
        run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
        working-directory: ../boost-root
      - name: Config info install
        run: ../../../b2 config_info_travis_install toolset=$TOOLSET
        working-directory: ../boost-root/libs/config/test
      - name: Config info
        run: ./config_info_travis
        working-directory: ../boost-root/libs/config/test
      - name: Test
        run: ../../../b2 toolset=$TOOLSET
        working-directory: ../boost-root/libs/type_traits/test
  ubuntu-jammy-clang:
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        compiler: [ clang++-11, clang++-12, clang++-13 ]
        standard: [ c++03, c++11, c++14, c++17, c++2a, gnu++03, gnu++11, gnu++14, gnu++17, gnu++2a ]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - uses: mstachniuk/ci-skip@v1
        with:
          commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
          commit-filter-separator: ';'
          fail-fast: true
      - name: Set TOOLSET
        run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
      - name: Add repository
        continue-on-error: true
        id: addrepo
        run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
      - name: Retry Add Repo
        continue-on-error: true
        id: retry1
        if: steps.addrepo.outcome=='failure'
        run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
      - name: Retry Add Repo 2
        continue-on-error: true
        id: retry2
        if: steps.retry1.outcome=='failure'
        run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
      - name: Install packages
        run: sudo apt install clang-11 clang-12 clang-13
      - name: Checkout main boost
        run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
      - name: Update tools/boostdep
        run: git submodule update --init tools/boostdep
        working-directory: ../boost-root
      - name: Copy files
        run: cp -r $GITHUB_WORKSPACE/* libs/type_traits
        working-directory: ../boost-root
      - name: Install deps
        run: python tools/boostdep/depinst/depinst.py type_traits
        working-directory: ../boost-root
      - name: Bootstrap
        run: ./bootstrap.sh
        working-directory: ../boost-root
      - name: Generate headers
        run: ./b2 headers
        working-directory: ../boost-root
      - name: Generate user config
        run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
        working-directory: ../boost-root
      - name: Config info install
        run: ../../../b2 config_info_travis_install toolset=$TOOLSET
        working-directory: ../boost-root/libs/config/test
      - name: Config info
        run: ./config_info_travis
        working-directory: ../boost-root/libs/config/test
      - name: Test
        run: ../../../b2 toolset=$TOOLSET
        working-directory: ../boost-root/libs/type_traits/test
  macos:
    runs-on: macos-latest
    strategy:
      fail-fast: false
      matrix:
        toolset: [ clang ]
        standard: [ "03", 11, 14, 17, 20 ]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - uses: mstachniuk/ci-skip@v1
        with:
          commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[linux];[Linux];[LINUX]'
          commit-filter-separator: ';'
          fail-fast: true
      - name: Checkout main boost
        run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
      - name: Update tools/boostdep
        run: git submodule update --init tools/boostdep
        working-directory: ../boost-root
      - name: Copy files
        run: cp -r $GITHUB_WORKSPACE/* libs/type_traits
        working-directory: ../boost-root
      - name: Install deps
        run: python tools/boostdep/depinst/depinst.py type_traits
        working-directory: ../boost-root
      - name: Bootstrap
        run: ./bootstrap.sh
        working-directory: ../boost-root
      - name: Generate headers
        run: ./b2 headers
        working-directory: ../boost-root
      - name: Config info install
        run: ../../../b2 config_info_travis_install toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }}
        working-directory: ../boost-root/libs/config/test
      - name: Config info
        run: ./config_info_travis
        working-directory: ../boost-root/libs/config/test
      - name: Test
        run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }}
        working-directory: ../boost-root/libs/type_traits/test
  windows_gcc:
    runs-on: windows-latest
    defaults:
      run:
        shell: cmd
    env:
      ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }}
    strategy:
      fail-fast: false
      matrix:
        standard: [ 11, 14, 17 ]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - uses: mstachniuk/ci-skip@v1
        with:
          commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
          commit-filter-separator: ';'
          fail-fast: true
      - name: Checkout main boost
        run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
      - name: Update tools/boostdep
        run: git submodule update --init tools/boostdep
        working-directory: ../boost-root
      - name: Copy files
        run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\type_traits
        working-directory: ../boost-root
      - name: Install deps
        run: python tools/boostdep/depinst/depinst.py type_traits
        working-directory: ../boost-root
      - name: Bootstrap
        run: bootstrap
        working-directory: ../boost-root
      - name: Generate headers
        run: b2 headers
        working-directory: ../boost-root
      - name: Config info install
        run: ..\..\..\b2 config_info_travis_install cxxstd=${{ matrix.standard }} toolset=gcc
        working-directory: ../boost-root/libs/config/test
      - name: Config info
        run: config_info_travis
        working-directory: ../boost-root/libs/config/test
      - name: Test
        run: ..\..\..\b2 --hash cxxstd=${{ matrix.standard }} toolset=gcc
        working-directory: ../boost-root/libs/type_traits/test
  windows_msvc_14_0:
    runs-on: windows-2019
    defaults:
      run:
        shell: cmd
    strategy:
      fail-fast: false
      matrix:
        standard: [ 14 ]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - uses: mstachniuk/ci-skip@v1
        with:
          commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
          commit-filter-separator: ';'
          fail-fast: true
      - name: Checkout main boost
        run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
      - name: Update tools/boostdep
        run: git submodule update --init tools/boostdep
        working-directory: ../boost-root
      - name: Copy files
        run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\type_traits
        working-directory: ../boost-root
      - name: Install deps
        run: python tools/boostdep/depinst/depinst.py type_traits
        working-directory: ../boost-root
      - name: Bootstrap
        run: bootstrap
        working-directory: ../boost-root
      - name: Generate headers
        run: b2 headers
        working-directory: ../boost-root
      - name: Config info install
        run: ..\..\..\b2 config_info_travis_install cxxstd=${{ matrix.standard }} toolset=msvc-14.0
        working-directory: ../boost-root/libs/config/test
      - name: Config info
        run: config_info_travis
        working-directory: ../boost-root/libs/config/test
      - name: Test
        run: ..\..\..\b2 --hash cxxstd=${{ matrix.standard }} toolset=msvc-14.0 define=CI_SUPPRESS_KNOWN_ISSUES
        working-directory: ../boost-root/libs/type_traits/test
  windows_msvc_14_2:
    runs-on: windows-2019
    defaults:
      run:
        shell: cmd
    strategy:
      fail-fast: false
      matrix:
        standard: [ 14, 17, latest ]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - uses: mstachniuk/ci-skip@v1
        with:
          commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
          commit-filter-separator: ';'
          fail-fast: true
      - name: Checkout main boost
        run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
      - name: Update tools/boostdep
        run: git submodule update --init tools/boostdep
        working-directory: ../boost-root
      - name: Copy files
        run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\type_traits
        working-directory: ../boost-root
      - name: Install deps
        run: python tools/boostdep/depinst/depinst.py type_traits
        working-directory: ../boost-root
      - name: Bootstrap
        run: bootstrap
        working-directory: ../boost-root
      - name: Generate headers
        run: b2 headers
        working-directory: ../boost-root
      - name: Config info install
        run: ..\..\..\b2 config_info_travis_install cxxstd=${{ matrix.standard }} toolset=msvc-14.2
        working-directory: ../boost-root/libs/config/test
      - name: Config info
        run: config_info_travis
        working-directory: ../boost-root/libs/config/test
      - name: Test
        run: ..\..\..\b2 --hash cxxstd=${{ matrix.standard }} toolset=msvc-14.2 define=CI_SUPPRESS_KNOWN_ISSUES
        working-directory: ../boost-root/libs/type_traits/test
  windows_msvc_14_3:
    runs-on: windows-2022
    defaults:
      run:
        shell: cmd
    strategy:
      fail-fast: false
      matrix:
        standard: [ 14, 17, latest ]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - uses: mstachniuk/ci-skip@v1
        with:
          commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
          commit-filter-separator: ';'
          fail-fast: true
      - name: Checkout main boost
        run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
      - name: Update tools/boostdep
        run: git submodule update --init tools/boostdep
        working-directory: ../boost-root
      - name: Copy files
        run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\type_traits
        working-directory: ../boost-root
      - name: Install deps
        run: python tools/boostdep/depinst/depinst.py type_traits
        working-directory: ../boost-root
      - name: Bootstrap
        run: bootstrap
        working-directory: ../boost-root
      - name: Generate headers
        run: b2 headers
        working-directory: ../boost-root
      - name: Config info install
        run: ..\..\..\b2 config_info_travis_install cxxstd=${{ matrix.standard }} toolset=msvc-14.3
        working-directory: ../boost-root/libs/config/test
      - name: Config info
        run: config_info_travis
        working-directory: ../boost-root/libs/config/test
      - name: Test
        run: ..\..\..\b2 --hash cxxstd=${{ matrix.standard }} toolset=msvc-14.3 define=CI_SUPPRESS_KNOWN_ISSUES
        working-directory: ../boost-root/libs/type_traits/test
  windows_msvc_14_2_clr:
    runs-on: windows-2019
    defaults:
      run:
        shell: cmd
    strategy:
      fail-fast: false
      matrix:
        standard: [ 14, 17 ]
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - uses: mstachniuk/ci-skip@v1
        with:
          commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
          commit-filter-separator: ';'
          fail-fast: true
      - name: Checkout main boost
        run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
      - name: Update tools/boostdep
        run: git submodule update --init tools/boostdep
        working-directory: ../boost-root
      - name: Copy files
        run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\type_traits
        working-directory: ../boost-root
      - name: Install deps
        run: python tools/boostdep/depinst/depinst.py type_traits
        working-directory: ../boost-root
      - name: Bootstrap
        run: bootstrap
        working-directory: ../boost-root
      - name: Generate headers
        run: b2 headers
        working-directory: ../boost-root
      - name: Config info install
        run: ..\..\..\b2 config_info_travis_install cxxstd=${{ matrix.standard }} toolset=msvc-14.2 cxxflags=-clr asynch-exceptions=on
        working-directory: ../boost-root/libs/config/test
      - name: Config info
        run: config_info_travis
        working-directory: ../boost-root/libs/config/test
      - name: Test
        run: ..\..\..\b2 --hash cxxstd=${{ matrix.standard }} toolset=msvc-14.2 define=CI_SUPPRESS_KNOWN_ISSUES cxxflags=-clr asynch-exceptions=on
        working-directory: ../boost-root/libs/type_traits/test
