[Backport PR-509] chore: Drop unnecessary __future__.annotations im…
#5
This file contains hidden or 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-unixish | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14, macos-15] | |
| compiler: [clang++] | |
| include: | |
| - os: ubuntu-22.04 | |
| compiler: g++ | |
| - os: ubuntu-24.04 | |
| compiler: g++ | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| CXX: ${{ matrix.compiler }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Install missing software on ubuntu | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install valgrind | |
| - name: Install missing software on ubuntu (clang++) | |
| if: matrix.os == 'ubuntu-24.04' && matrix.compiler == 'clang++' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libc++-18-dev | |
| - name: Install missing software on macos | |
| if: contains(matrix.os, 'macos') | |
| run: | | |
| brew install python3 | |
| - name: Install missing Python packages | |
| run: | | |
| python3 -m pip config set global.break-system-packages true | |
| python3 -m pip install pytest | |
| - name: make simplecpp | |
| run: make -j$(nproc) CXXOPTS="-Werror" | |
| - name: make test | |
| run: make -j$(nproc) test CXXOPTS="-Werror" | |
| - name: selfcheck | |
| run: | | |
| make -j$(nproc) selfcheck | |
| - name: Run CMake | |
| run: | | |
| cmake -S . -B cmake.output -DCMAKE_COMPILE_WARNING_AS_ERROR=On | |
| - name: CMake simplecpp | |
| run: | | |
| cmake --build cmake.output --target simplecpp -- -j $(nproc) | |
| - name: CMake testrunner | |
| run: | | |
| cmake --build cmake.output --target testrunner -- -j $(nproc) | |
| ./cmake.output/testrunner | |
| # Re-run tests from within the build directory to validate that | |
| # SIMPLECPP_TEST_SOURCE_DIR is correctly defined and resolved | |
| (cd cmake.output && ./testrunner) | |
| - name: Run valgrind | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: | | |
| make clean | |
| make -j$(nproc) | |
| valgrind --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42 ./testrunner | |
| valgrind --leak-check=full --num-callers=50 --show-reachable=yes --track-origins=yes --gen-suppressions=all --error-exitcode=42 ./simplecpp simplecpp.cpp -e | |
| - name: Run with libstdc++ debug mode | |
| if: matrix.os == 'ubuntu-24.04' && matrix.compiler == 'g++' | |
| run: | | |
| make clean | |
| make -j$(nproc) test selfcheck CXXOPTS="-Werror -g3 -D_GLIBCXX_DEBUG" | |
| - name: Run with libc++ hardening mode | |
| if: matrix.os == 'ubuntu-24.04' && matrix.compiler == 'clang++' | |
| run: | | |
| make clean | |
| make -j$(nproc) test selfcheck CXXOPTS="-Werror -stdlib=libc++ -g3 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" LDOPTS="-lc++" | |
| - name: Run AddressSanitizer | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: | | |
| make clean | |
| make -j$(nproc) test selfcheck CXXOPTS="-Werror -O2 -g3 -fsanitize=address" LDOPTS="-fsanitize=address" | |
| env: | |
| ASAN_OPTIONS: detect_stack_use_after_return=1 | |
| - name: Run UndefinedBehaviorSanitizer | |
| if: matrix.os == 'ubuntu-24.04' | |
| run: | | |
| make clean | |
| make -j$(nproc) test selfcheck CXXOPTS="-Werror -O2 -g3 -fsanitize=undefined -fno-sanitize=signed-integer-overflow" LDOPTS="-fsanitize=undefined -fno-sanitize=signed-integer-overflow" | |
| env: | |
| UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:report_error_type=1 | |
| # TODO: requires instrumented libc++ | |
| - name: Run MemorySanitizer | |
| if: false && matrix.os == 'ubuntu-24.04' && matrix.compiler == 'clang++' | |
| run: | | |
| make clean | |
| make -j$(nproc) test selfcheck CXXOPTS="-Werror -O2 -g3 -stdlib=libc++ -fsanitize=memory" LDOPTS="-lc++ -fsanitize=memory" |