You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trompeloeil/.github/workflows/ci.yml

803 lines
23 KiB
YAML

name: CI
# Trigger on pushes to all branches and for all pull-requests
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
# GCC-4.8
- {
name: "Linux GCC 4.8 C++11",
os: ubuntu-16.04,
cc: "gcc-4.8", cxx: "g++-4.8",
cxx_standard: 11,
cxx_asan: true
}
# GCC-4.9
- {
name: "Linux GCC 4.9 C++11",
os: ubuntu-16.04,
cc: "gcc-4.9", cxx: "g++-4.9",
cxx_standard: 11,
cxx_asan: true
}
- {
name: "Linux GCC 4.9 C++14",
os: ubuntu-16.04,
cc: "gcc-4.9", cxx: "g++-4.9",
cxx_standard: 14,
cxx_asan: true
}
# GCC-5
- {
name: "Linux GCC 5 C++11",
os: ubuntu-16.04,
cc: "gcc-5", cxx: "g++-5",
cxx_standard: 11,
cxx_asan: true
}
- {
name: "Linux GCC 5 C++14",
os: ubuntu-16.04,
cc: "gcc-5", cxx: "g++-5",
cxx_standard: 14,
cxx_asan: true
}
- {
name: "Linux GCC 5 C++17",
os: ubuntu-16.04,
cc: "gcc-5", cxx: "g++-5",
cxx_standard: 17,
cxx_asan: true
}
# GCC-6
- {
name: "Linux GCC 6 C++11",
os: ubuntu-16.04,
cc: "gcc-6", cxx: "g++-6",
cxx_standard: 11,
cxx_asan: true
}
- {
name: "Linux GCC 6 C++14",
os: ubuntu-16.04,
cc: "gcc-6", cxx: "g++-6",
cxx_standard: 14,
cxx_asan: true
}
- {
name: "Linux GCC 6 C++17",
os: ubuntu-16.04,
cc: "gcc-6", cxx: "g++-6",
cxx_standard: 17,
cxx_asan: true
}
# GCC-7
- {
name: "Linux GCC 7 C++11",
os: ubuntu-20.04,
cc: "gcc-7", cxx: "g++-7",
cxx_standard: 11,
cxx_asan: true
}
- {
name: "Linux GCC 7 C++14",
os: ubuntu-20.04,
cc: "gcc-7", cxx: "g++-7",
cxx_standard: 14,
cxx_asan: true
}
- {
name: "Linux GCC 7 C++17",
os: ubuntu-20.04,
cc: "gcc-7", cxx: "g++-7",
cxx_standard: 17,
cxx_asan: true
}
# GCC-8
- {
name: "Linux GCC 8 C++11",
os: ubuntu-20.04,
cc: "gcc-8", cxx: "g++-8",
cxx_standard: 11,
cxx_asan: true
}
- {
name: "Linux GCC 8 C++14",
os: ubuntu-20.04,
cc: "gcc-8", cxx: "g++-8",
cxx_standard: 14,
cxx_asan: true
}
- {
name: "Linux GCC 8 C++17",
os: ubuntu-20.04,
cc: "gcc-8", cxx: "g++-8",
cxx_standard: 17,
cxx_asan: true
}
# GCC-9
- {
name: "Linux GCC 9 C++11",
os: ubuntu-20.04,
cc: "gcc-9", cxx: "g++-9",
cxx_standard: 11,
cxx_asan: true
}
- {
name: "Linux GCC 9 C++14",
os: ubuntu-20.04,
cc: "gcc-9", cxx: "g++-9",
cxx_standard: 14,
cxx_asan: true
}
- {
name: "Linux GCC 9 C++17",
os: ubuntu-20.04,
cc: "gcc-9", cxx: "g++-9",
cxx_standard: 17,
cxx_asan: true
}
# GCC-10
- {
name: "Linux GCC 10 C++11",
os: ubuntu-20.04,
cc: "gcc-10", cxx: "g++-10",
cxx_standard: 11,
cxx_asan: true
}
- {
name: "Linux GCC 10 C++14",
os: ubuntu-20.04,
cc: "gcc-10", cxx: "g++-10",
cxx_standard: 14,
cxx_asan: true
}
- {
name: "Linux GCC 10 C++17",
os: ubuntu-20.04,
cc: "gcc-10", cxx: "g++-10",
cxx_standard: 17,
cxx_asan: true
}
- {
name: "Linux GCC 10 C++20",
os: ubuntu-20.04,
cc: "gcc-10", cxx: "g++-10",
cxx_standard: 20,
cxx_asan: true
}
# GCC-11
- {
name: "Linux GCC 11 C++11",
os: ubuntu-20.04,
cc: "gcc-11", cxx: "g++-11",
cxx_standard: 11,
cxx_asan: true
}
- {
name: "Linux GCC 11 C++14",
os: ubuntu-20.04,
cc: "gcc-11", cxx: "g++-11",
cxx_standard: 14,
cxx_asan: true
}
- {
name: "Linux GCC 11 C++17",
os: ubuntu-20.04,
cc: "gcc-11", cxx: "g++-11",
cxx_standard: 17,
cxx_asan: true
}
- {
name: "Linux GCC 11 C++20",
os: ubuntu-20.04,
cc: "gcc-11", cxx: "g++-11",
cxx_standard: 20,
cxx_asan: true
}
# Clang-5.0
- {
name: "Linux Clang 5.0 C++11 / libstdc++",
os: ubuntu-16.04,
cc: "clang-5.0", cxx: "clang++-5.0",
cxx_standard: 11,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 5.0 C++14 / libstdc++",
os: ubuntu-16.04,
cc: "clang-5.0", cxx: "clang++-5.0",
cxx_standard: 14,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 5.0 C++17 / libstdc++",
os: ubuntu-16.04,
cc: "clang-5.0", cxx: "clang++-5.0",
cxx_standard: 17,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 5.0 C++11 / libc++",
os: ubuntu-16.04,
cc: "clang-5.0", cxx: "clang++-5.0",
cxx_standard: 11,
cxx_asan: true,
libcxx: true
}
- {
name: "Linux Clang 5.0 C++14 / libc++",
os: ubuntu-16.04,
cc: "clang-5.0", cxx: "clang++-5.0",
cxx_standard: 14,
cxx_asan: true,
libcxx: true
}
- {
name: "Linux Clang 5.0 C++17 / libc++",
os: ubuntu-16.04,
cc: "clang-5.0", cxx: "clang++-5.0",
cxx_standard: 17,
cxx_asan: true,
libcxx: true
}
# Clang-6.0
- {
name: "Linux Clang 6.0 C++11 / libstdc++",
os: ubuntu-16.04,
cc: "clang-6.0", cxx: "clang++-6.0",
cxx_standard: 11,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 6.0 C++14 / libstdc++",
os: ubuntu-16.04,
cc: "clang-6.0", cxx: "clang++-6.0",
cxx_standard: 14,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 6.0 C++17 / libstdc++",
os: ubuntu-16.04,
cc: "clang-6.0", cxx: "clang++-6.0",
cxx_standard: 17,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 6.0 C++11 / libc++",
os: ubuntu-16.04,
cc: "clang-6.0", cxx: "clang++-6.0",
cxx_standard: 11,
cxx_asan: true,
libcxx: true
}
- {
name: "Linux Clang 6.0 C++14 / libc++",
os: ubuntu-16.04,
cc: "clang-6.0", cxx: "clang++-6.0",
cxx_standard: 14,
cxx_asan: true,
libcxx: true
}
- {
name: "Linux Clang 6.0 C++17 / libc++",
os: ubuntu-16.04,
cc: "clang-6.0", cxx: "clang++-6.0",
cxx_standard: 17,
cxx_asan: true,
libcxx: true
}
# Clang-8
- {
name: "Linux Clang 8 C++11 / libstdc++",
os: ubuntu-20.04,
cc: "clang-8", cxx: "clang++-8",
cxx_standard: 11,
cxx_asan: false,
libcxx: false
}
- {
name: "Linux Clang 8 C++14 / libstdc++",
os: ubuntu-20.04,
cc: "clang-8", cxx: "clang++-8",
cxx_standard: 14,
cxx_asan: false,
libcxx: false
}
- {
name: "Linux Clang 8 C++17 / libstdc++",
os: ubuntu-20.04,
cc: "clang-8", cxx: "clang++-8",
cxx_standard: 17,
cxx_asan: false,
libcxx: false
}
- {
name: "Linux Clang 8 C++11 / libc++",
os: ubuntu-20.04,
cc: "clang-8", cxx: "clang++-8",
cxx_standard: 11,
cxx_asan: false,
libcxx: true
}
- {
name: "Linux Clang 8 C++14 / libc++",
os: ubuntu-20.04,
cc: "clang-8", cxx: "clang++-8",
cxx_standard: 14,
cxx_asan: false,
libcxx: true
}
- {
name: "Linux Clang 8 C++17 / libc++",
os: ubuntu-20.04,
cc: "clang-8", cxx: "clang++-8",
cxx_standard: 17,
cxx_asan: false,
libcxx: true
}
# Clang-9
- {
name: "Linux Clang 9 C++11 / libstdc++",
os: ubuntu-20.04,
cc: "clang-9", cxx: "clang++-9",
cxx_standard: 11,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 9 C++14 / libstdc++",
os: ubuntu-20.04,
cc: "clang-9", cxx: "clang++-9",
cxx_standard: 14,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 9 C++17 / libstdc++",
os: ubuntu-20.04,
cc: "clang-9", cxx: "clang++-9",
cxx_standard: 17,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 9 C++11 / libc++",
os: ubuntu-20.04,
cc: "clang-9", cxx: "clang++-9",
cxx_standard: 11,
cxx_asan: true,
libcxx: true
}
- {
name: "Linux Clang 9 C++14 / libc++",
os: ubuntu-20.04,
cc: "clang-9", cxx: "clang++-9",
cxx_standard: 14,
cxx_asan: true,
libcxx: true
}
- {
name: "Linux Clang 9 C++17 / libc++",
os: ubuntu-20.04,
cc: "clang-9", cxx: "clang++-9",
cxx_standard: 17,
cxx_asan: true,
libcxx: true
}
# Clang-10
- {
name: "Linux Clang 10 C++11 / libstdc++",
os: ubuntu-20.04,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 11,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 10 C++14 / libstdc++",
os: ubuntu-20.04,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 14,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 10 C++17 / libstdc++",
os: ubuntu-20.04,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 17,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 10 C++20 / libstdc++",
os: ubuntu-20.04,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 20,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 10 C++11 / libc++",
os: ubuntu-20.04,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 11,
cxx_asan: true,
libcxx: true
}
- {
name: "Linux Clang 10 C++14 / libc++",
os: ubuntu-20.04,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 14,
cxx_asan: true,
libcxx: true
}
- {
name: "Linux Clang 10 C++17 / libc++",
os: ubuntu-20.04,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 17,
cxx_asan: true,
libcxx: true
}
- {
name: "Linux Clang 10 C++20 / libc++",
os: ubuntu-20.04,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 20,
cxx_asan: true,
libcxx: true
}
# Clang-11
- {
name: "Linux Clang 11 C++11 / libstdc++",
os: ubuntu-20.04,
cc: "clang-11", cxx: "clang++-11",
cxx_standard: 11,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 11 C++14 / libstdc++",
os: ubuntu-20.04,
cc: "clang-11", cxx: "clang++-11",
cxx_standard: 14,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 11 C++17 / libstdc++",
os: ubuntu-20.04,
cc: "clang-11", cxx: "clang++-11",
cxx_standard: 17,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 11 C++20 / libstdc++",
os: ubuntu-20.04,
cc: "clang-11", cxx: "clang++-11",
cxx_standard: 20,
cxx_asan: true,
libcxx: false
}
# Clang-12
- {
name: "Linux Clang 12 C++11 / libstdc++",
os: ubuntu-20.04,
cc: "clang-12", cxx: "clang++-12",
cxx_standard: 11,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 12 C++14 / libstdc++",
os: ubuntu-20.04,
cc: "clang-12", cxx: "clang++-12",
cxx_standard: 14,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 12 C++17 / libstdc++",
os: ubuntu-20.04,
cc: "clang-12", cxx: "clang++-12",
cxx_standard: 17,
cxx_asan: true,
libcxx: false
}
- {
name: "Linux Clang 12 C++20 / libstdc++",
os: ubuntu-20.04,
cc: "clang-12", cxx: "clang++-12",
cxx_standard: 20,
cxx_asan: true,
libcxx: false
}
# AppleClang
- {
name: "macOS Clang C++11",
os: macos-latest,
cc: "clang", cxx: "clang++",
cxx_standard: 11,
cxx_asan: true
}
- {
name: "macOS Clang C++14",
os: macos-latest,
cc: "clang", cxx: "clang++",
cxx_standard: 14,
cxx_asan: true
}
- {
name: "macOS Clang C++17",
os: macos-latest,
cc: "clang", cxx: "clang++",
cxx_standard: 17,
cxx_asan: true
}
# MSVC 2019
- {
name: "Windows MSVC 2019 C++11",
os: windows-2019,
cc: "cl", cxx: "cl",
cxx_standard: 11,
}
- {
name: "Windows MSVC 2019 C++14",
os: windows-2019,
cc: "cl", cxx: "cl",
cxx_standard: 14,
}
- {
name: "Windows MSVC 2019 C++17",
os: windows-2019,
cc: "cl", cxx: "cl",
cxx_standard: 17,
}
- {
name: "Windows MSVC 2019 C++20",
os: windows-2019,
cc: "cl", cxx: "cl",
cxx_standard: 20,
}
- {
name: "Windows MSVC 2017 C++11",
os: windows-2016,
cc: "cl", cxx: "cl",
cxx_standard: 11,
}
- {
name: "Windows MSVC 2017 C++14",
os: windows-2016,
cc: "cl", cxx: "cl",
cxx_standard: 14,
}
- {
name: "Windows MSVC 2017 C++17",
os: windows-2016,
cc: "cl", cxx: "cl",
cxx_standard: 17,
}
steps:
- uses: actions/checkout@v2
- name: Install GCC 4.8
id: install_gcc_4_8
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-4.8' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install -y gcc-4.8 g++-4.8
- name: Install GCC 4.9
id: install_gcc_4_9
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-4.9' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install -y gcc-4.9 g++-4.9
- name: Install GCC 6
id: install_gcc_6
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-6' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install -y gcc-6 g++-6
- name: Install GCC 7
id: install_gcc_7
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-7' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install -y gcc-7 g++-7
- name: Install GCC 8
id: install_gcc_8
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-8' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install -y gcc-8 g++-8
- name: Install GCC 11
id: install_gcc_11
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'g++-11' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get update && sudo apt-get install -y gcc-11 g++-11
- name: Install Clang 5
id: install_clang_5
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-5.0' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install -y clang-5.0
- name: Install Clang 6
id: install_clang_6
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-6.0' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install -y clang-6.0
- name: Install Clang 8
id: install_clang_8
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-8' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install -y clang-8
- name: Install Clang 9
id: install_clang_9
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-9' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
sudo apt-get install -y clang-9
- name: Install Clang 11
id: install_clang_11
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-11' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 11
- name: Install Clang 12
id: install_clang_12
if: startsWith(matrix.config.os, 'ubuntu') && ( matrix.config.cxx == 'clang++-12' )
shell: bash
working-directory: ${{ env.HOME }}
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 12
- name: Install libc++
id: install_libcxx
if: matrix.config.libcxx
shell: bash
working-directory: ${{ env.HOME }}
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
run: |
$GITHUB_WORKSPACE/install_libcxx.sh
- name: Install kcov
if: startsWith(matrix.config.os, 'ubuntu')
run: |
sudo apt-get install -y kcov
- name: Verify compilation errors
if: (!startsWith(matrix.config.os, 'windows'))
shell: bash
run: |
CXX=${{ matrix.config.cxx }} CXXFLAGS="-std=c++${{ matrix.config.cxx_standard }}" ./check_errors.sh ||
{
FAILURES="$?" ;
if [[ "${{ matrix.config.cxx_standard }}" == "11" ]]; then
if [[ ${FAILURES} != "4" ]]; then
echo "Expected four failures from C++11 check_errors.sh, got ${FAILURES}" ;
exit 1 ;
fi ;
else
echo "Expected zero failures from check_errors.sh, got ${FAILURES}" ;
exit 1 ;
fi ;
}
- name: Configure
shell: bash
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
run: |
if [ "x${{ matrix.config.libcxx }}" == "xtrue" ]
then
cxx_flags="${cxx_flags} -stdlib=libc++ -nostdinc++ -cxx-isystem ${GITHUB_WORKSPACE}/llvm/include/c++/v1/ -Wno-unused-command-line-argument"
link_flags="${link_flags} -L ${GITHUB_WORKSPACE}/llvm/lib -Wl,-rpath,${GITHUB_WORKSPACE}/llvm/lib -lc++abi"
fi
if [ "x${{ matrix.config.cxx_asan }}" == "xtrue" ]
then
cxx_flags="${cxx_flags} -fno-omit-frame-pointer"
fi
cmake \
-S . \
-B build \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_VERBOSE_MAKEFILE=ON \
-D CXX_STANDARD:STRING=${{ matrix.config.cxx_standard }} \
-D "CMAKE_CXX_FLAGS:STRING=${cxx_flags}" \
-D "CMAKE_EXE_LINKER_FLAGS:STRING=${link_flags}" \
-D SANITIZE=${{matrix.config.cxx_asan}} \
${{ matrix.config.cmake_args }} \
${extra_cmake_args}
- name: Build
shell: bash
run: |
cmake --build build --parallel 4 --target self_test custom_recursive_mutex
- name: Run tests
shell: bash
run: |
cmake --build build --target run_self_test
- name: Collect coverage
if: (startsWith(matrix.config.os, 'ubuntu'))
shell: bash
run: |
cmake --build build --target run_coverage || true
- name: Upload coverage
if: startsWith(matrix.config.os, 'ubuntu') && github.repository == 'rollbear/trompeloeil'
uses: codecov/codecov-action@v1
with:
directory: build/coverage
files: self_test*/cobertura.xml
name: ${{ matrix.config.name }}
fail_ci_if_error: true
verbose: true