CI linux #26
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: CI_ubuntu | |
permissions: | |
actions: write | |
contents: read | |
'on': | |
pull_request: | |
push: | |
branches: | |
- master | |
env: | |
UBSAN_OPTIONS: print_stacktrace=1 | |
jobs: | |
posix: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - type: Debug | |
# compiler: clang | |
# cxx_compiler: clang++ | |
# version: 17 | |
- type: Debug | |
compiler: clang | |
cxx_compiler: clang++ | |
version: 19 | |
# - type: Debug | |
# compiler: gcc | |
# cxx_compiler: g++ | |
# version: 11 | |
- type: Debug | |
compiler: gcc | |
cxx_compiler: g++ | |
version: 14 | |
name: '${{matrix.type}} ${{matrix.compiler}}-${{matrix.version}}' | |
runs-on: ubuntu-24.04 #bug in std library(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115119) | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.9.1 | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
- name: install based dependencies | |
run: | | |
sudo apt install ccache | |
sudo apt install cmake | |
cmake --version | |
sudo apt install lld | |
sudo apt install ninja-build | |
sudo apt install build-essential | |
sudo apt-get install libc++-dev libc++abi-dev | |
- name: install compiler | |
run: > | |
sudo make | |
-f scripts/ci_ubuntu.make | |
install-compiler | |
compiler=${{matrix.compiler}} | |
version=${{matrix.version}} | |
- name: Setup ccache | |
run: | | |
ccache -M 2.0GB | |
- name: Reuse ccache directory | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/ccache | |
key: 'ubuntu-22.04 ${{matrix.type}} ${{matrix.compiler}}-${{matrix.version}} ccache-dir ${{github.ref}}' | |
restore-keys: | | |
ubuntu-22.04 ${{matrix.type}} ${{matrix.compiler}}-${{matrix.version}} ccache-dir ${{github.ref}} | |
ubuntu-22.04 ${{matrix.type}} ${{matrix.compiler}}-${{matrix.version}} ccache- | |
- name: ccache stats before build | |
run: | | |
ccache -s | |
- name: Configure cmake project | |
run: > | |
cmake | |
-B cmake_build | |
-G Ninja | |
-DCMAKE_BUILD_TYPE=${{matrix.type}} | |
-DCMAKE_C_COMPILER=${{matrix.compiler}}-${{matrix.version}} | |
-DCMAKE_CXX_COMPILER=${{matrix.cxx_compiler}}-${{matrix.version}} | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
-DTGBM_ENABLE_TESTS=ON | |
-DCMAKE_LINKER_TYPE=LLD | |
-DCMAKE_CXX_STANDARD=20 | |
-DCMAKE_CXX_FLAGS="-stdlib=libc++" | |
-DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" | |
- name: Build project | |
run: > | |
cmake | |
--build cmake_build | |
--target all | |
- name: ccache stats after build | |
run: | | |
ccache -s | |
- name: Run tests | |
run: | | |
cd cmake_build | |
(test -t 1 && GTEST_COLOR=1 PYTEST_ADDOPTS="--color=yes" ctest -V) || ctest -V |