clang linux #498
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: clang linux | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '20 3 * * *' | |
env: | |
TEST_DIR: ./tests | |
jobs: | |
all: | |
strategy: | |
fail-fast: false | |
matrix: | |
clang_version: [13, 15] | |
cpp_version: [c++17, c++20] | |
stdlib: [libc++, libstdc++] # llvm library and gcc library | |
arch: [m64, m32] # 64 and 32 bit | |
buildmode: [~ , -O3 -DNDEBUG, -O3 -DNDEBUG -ffast-math] | |
# Also include a few variations with disabled UB tricks (not for all to limit resource consumption). | |
include: | |
- clang_version: 15 | |
cpp_version: c++20 | |
stdlib: libc++ | |
arch: m64 | |
buildmode: -DTINY_OPTIONAL_USE_SEPARATE_BOOL_INSTEAD_OF_UB_TRICKS | |
- clang_version: 15 | |
cpp_version: c++20 | |
stdlib: libstdc++ | |
arch: m64 | |
buildmode: -DTINY_OPTIONAL_USE_SEPARATE_BOOL_INSTEAD_OF_UB_TRICKS | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install libc++ if required | |
# libc++ is not installed for all clang versions by default. | |
if: ${{ matrix.stdlib == 'libc++' && matrix.arch == 'm64' }} | |
run: | | |
sudo apt update | |
sudo apt install ${{ format('libc++-{0}-dev libc++abi-{0}-dev', matrix.clang_version) }} -y | |
- name: Install gcc-multilib and libc++ for x86 if required | |
# For x86: We require both gcc multilib and the 32-bit variant (i386) of libc++ for the | |
# used clang version. For libc++ we need to manually add the i386 architecture. | |
if: ${{ matrix.arch == 'm32' }} | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt update | |
sudo apt install gcc-multilib g++-multilib ${{ format('libc++-{0}-dev:i386 libc++abi-{0}-dev:i386', matrix.clang_version) }} -y | |
- name: Build and run tests | |
working-directory: ${{env.TEST_DIR}} | |
env: | |
CXX: ${{ format('clang++-{0}', matrix.clang_version) }} | |
ADDITIONAL_FLAGS: ${{ format('-{0} -std={1} -stdlib={2} {3}', matrix.arch, matrix.cpp_version, matrix.stdlib, matrix.buildmode) }} | |
run: make generic | |