Repository navigation
release: prepare num8 v2.0.0 #12
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 | |
| on: | |
| push: | |
| branches: ["master", "main"] | |
| pull_request: | |
| branches: ["master", "main"] | |
| permissions: | |
| contents: read | |
| jobs: | |
| ubuntu-build: | |
| name: ubuntu-${{ matrix.compiler }}-${{ matrix.build_type }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - compiler: gcc | |
| cc: gcc | |
| cxx: g++ | |
| build_type: Debug | |
| warnings: -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -Wshadow -Wformat=2 -Wundef | |
| - compiler: gcc | |
| cc: gcc | |
| cxx: g++ | |
| build_type: Release | |
| warnings: -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -Wshadow -Wformat=2 -Wundef | |
| - compiler: clang | |
| cc: clang | |
| cxx: clang++ | |
| build_type: Debug | |
| warnings: -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -Wshadow -Wformat=2 -Wundef -Wno-unused-command-line-argument | |
| - compiler: clang | |
| cc: clang | |
| cxx: clang++ | |
| build_type: Release | |
| warnings: -Wall -Wextra -Wpedantic -Werror -Wconversion -Wsign-conversion -Wshadow -Wformat=2 -Wundef -Wno-unused-command-line-argument | |
| env: | |
| CFLAGS: ${{ matrix.warnings }} | |
| CXXFLAGS: ${{ matrix.warnings }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure | |
| env: | |
| CC: ${{ matrix.cc }} | |
| CXX: ${{ matrix.cxx }} | |
| run: > | |
| cmake -S . -B build/${{ matrix.compiler }}-${{ matrix.build_type }} | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| -DNUM8_BUILD_TESTS=ON | |
| -DNUM8_BUILD_TOOLS=ON | |
| -DNUM8_BUILD_BENCHMARKS=OFF | |
| - name: Build | |
| run: cmake --build build/${{ matrix.compiler }}-${{ matrix.build_type }} --parallel | |
| - name: Test | |
| run: ctest --test-dir build/${{ matrix.compiler }}-${{ matrix.build_type }} --output-on-failure | |
| windows-build: | |
| name: windows-${{ matrix.build_type }} | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build_type: [Debug, Release] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure | |
| run: > | |
| cmake -S . -B build/${{ matrix.build_type }} | |
| -A x64 | |
| -DNUM8_BUILD_TESTS=ON | |
| -DNUM8_BUILD_TOOLS=ON | |
| -DNUM8_BUILD_BENCHMARKS=OFF | |
| - name: Build | |
| run: cmake --build build/${{ matrix.build_type }} --config ${{ matrix.build_type }} --parallel | |
| - name: Test | |
| run: ctest --test-dir build/${{ matrix.build_type }} -C ${{ matrix.build_type }} --output-on-failure | |
| package-install: | |
| name: ubuntu-package-install | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure | |
| run: > | |
| cmake -S . -B build/package | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DNUM8_BUILD_TESTS=ON | |
| -DNUM8_BUILD_TOOLS=ON | |
| -DNUM8_BUILD_BENCHMARKS=OFF | |
| - name: Build | |
| run: cmake --build build/package --parallel | |
| - name: Install | |
| run: cmake --install build/package --prefix "$RUNNER_TEMP/num8-prefix" | |
| - name: External consumer | |
| run: ctest --test-dir build/package -R num8_external_consumer --output-on-failure | |
| benchmark-smoke: | |
| name: ubuntu-benchmark-smoke | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure | |
| run: > | |
| cmake -S . -B build/bench | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DNUM8_BUILD_TESTS=OFF | |
| -DNUM8_BUILD_TOOLS=ON | |
| -DNUM8_BUILD_BENCHMARKS=ON | |
| - name: Build | |
| run: cmake --build build/bench --parallel | |
| - name: Smoke | |
| run: ./build/bench/num8_bench | |
| asan: | |
| name: ubuntu-asan | |
| runs-on: ubuntu-latest | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| CFLAGS: -fsanitize=address -fno-omit-frame-pointer | |
| CXXFLAGS: -fsanitize=address -fno-omit-frame-pointer | |
| LDFLAGS: -fsanitize=address | |
| ASAN_OPTIONS: detect_leaks=1:abort_on_error=1 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure | |
| run: > | |
| cmake -S . -B build/asan | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DNUM8_BUILD_TESTS=ON | |
| -DNUM8_BUILD_TOOLS=ON | |
| -DNUM8_BUILD_BENCHMARKS=OFF | |
| - name: Build | |
| run: cmake --build build/asan --parallel | |
| - name: Test | |
| run: ctest --test-dir build/asan --output-on-failure | |
| ubsan: | |
| name: ubuntu-ubsan | |
| runs-on: ubuntu-latest | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| CFLAGS: -fsanitize=undefined -fno-sanitize-recover=all | |
| CXXFLAGS: -fsanitize=undefined -fno-sanitize-recover=all | |
| LDFLAGS: -fsanitize=undefined | |
| UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure | |
| run: > | |
| cmake -S . -B build/ubsan | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DNUM8_BUILD_TESTS=ON | |
| -DNUM8_BUILD_TOOLS=ON | |
| -DNUM8_BUILD_BENCHMARKS=OFF | |
| - name: Build | |
| run: cmake --build build/ubsan --parallel | |
| - name: Test | |
| run: ctest --test-dir build/ubsan --output-on-failure | |
| lsan: | |
| name: ubuntu-lsan | |
| runs-on: ubuntu-latest | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| CFLAGS: -fsanitize=leak | |
| CXXFLAGS: -fsanitize=leak | |
| LDFLAGS: -fsanitize=leak | |
| LSAN_OPTIONS: exitcode=23 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure | |
| run: > | |
| cmake -S . -B build/lsan | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DNUM8_BUILD_TESTS=ON | |
| -DNUM8_BUILD_TOOLS=ON | |
| -DNUM8_BUILD_BENCHMARKS=OFF | |
| - name: Build | |
| run: cmake --build build/lsan --parallel | |
| - name: Test | |
| run: ctest --test-dir build/lsan --output-on-failure | |
| cppcheck: | |
| name: cppcheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install cppcheck | |
| run: sudo apt-get update && sudo apt-get install -y cppcheck | |
| - name: Check | |
| run: > | |
| cppcheck --enable=warning,style,performance,portability | |
| --error-exitcode=1 | |
| --suppress=variableScope | |
| --suppress=knownConditionTrueFalse | |
| -I . | |
| num8.c num8_builder.c num8_selftest.c num8_minitest.c num8_bench.c | |
| clang-analyze: | |
| name: clang-analyze | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install clang | |
| run: sudo apt-get update && sudo apt-get install -y clang | |
| - name: Analyze | |
| run: | | |
| set -euo pipefail | |
| clang --analyze -std=c11 -I . \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.DeprecatedOrUnsafeBufferHandling \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.strcpy \ | |
| -Xanalyzer -analyzer-disable-checker=unix.Malloc \ | |
| num8.c | |
| clang --analyze -std=c11 -I . \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.DeprecatedOrUnsafeBufferHandling \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.strcpy \ | |
| -Xanalyzer -analyzer-disable-checker=unix.Malloc \ | |
| num8_builder.c | |
| clang --analyze -std=c11 -I . \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.DeprecatedOrUnsafeBufferHandling \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.strcpy \ | |
| -Xanalyzer -analyzer-disable-checker=unix.Malloc \ | |
| num8_selftest.c | |
| clang --analyze -std=c11 -I . \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.DeprecatedOrUnsafeBufferHandling \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.strcpy \ | |
| -Xanalyzer -analyzer-disable-checker=unix.Malloc \ | |
| num8_minitest.c | |
| clang --analyze -std=c11 -I . \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.DeprecatedOrUnsafeBufferHandling \ | |
| -Xanalyzer -analyzer-disable-checker=security.insecureAPI.strcpy \ | |
| -Xanalyzer -analyzer-disable-checker=unix.Malloc \ | |
| num8_bench.c | |
| clang-tidy: | |
| name: clang-tidy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install clang-tidy | |
| run: sudo apt-get update && sudo apt-get install -y clang-tidy clang | |
| - name: Configure | |
| run: > | |
| cmake -S . -B build/clang-tidy | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| -DNUM8_BUILD_TESTS=ON | |
| -DNUM8_BUILD_TOOLS=ON | |
| -DNUM8_BUILD_BENCHMARKS=OFF | |
| - name: Build | |
| run: cmake --build build/clang-tidy --parallel | |
| - name: Analyze | |
| run: | | |
| set -euo pipefail | |
| clang-tidy -p build/clang-tidy --checks=clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-unix.Malloc --warnings-as-errors='*' num8.c | |
| clang-tidy -p build/clang-tidy --checks=clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-unix.Malloc --warnings-as-errors='*' num8_builder.c | |
| clang-tidy -p build/clang-tidy --checks=clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-unix.Malloc --warnings-as-errors='*' num8_selftest.c | |
| clang-tidy -p build/clang-tidy --checks=clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-unix.Malloc --warnings-as-errors='*' num8_minitest.c | |
| clang-tidy -p build/clang-tidy --checks=clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-unix.Malloc --warnings-as-errors='*' num8_bench.c |