netcode_generate_connect_token: bound num_server_addresses at runtime (#173) #326
Workflow file for this run
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: [ main ] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| name: ${{ matrix.os }} ${{ matrix.config }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-24.04, ubuntu-24.04-arm, macos-15, windows-2025 ] # linux x64, linux arm64, apple silicon, windows x64 | |
| config: [ Debug, Release ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure | |
| run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} | |
| - name: Build | |
| run: cmake --build build --config ${{ matrix.config }} --parallel | |
| - name: Test | |
| run: ctest --test-dir build --build-config ${{ matrix.config }} --output-on-failure --timeout 600 | |
| mingw: | |
| name: windows-2025 MinGW | |
| runs-on: windows-2025 | |
| timeout-minutes: 30 | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up MinGW | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: true | |
| install: >- | |
| mingw-w64-x86_64-gcc | |
| mingw-w64-x86_64-cmake | |
| mingw-w64-x86_64-ninja | |
| - name: Configure | |
| run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: cmake --build build --parallel | |
| - name: Test | |
| run: ctest --test-dir build --output-on-failure --timeout 600 | |
| system-sodium: | |
| name: ubuntu-24.04 system sodium | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install libsodium | |
| run: sudo apt-get update && sudo apt-get install -y libsodium-dev | |
| - name: Configure | |
| run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DNETCODE_SYSTEM_SODIUM=ON -DBUILD_SHARED_LIBS=ON | |
| - name: Build | |
| run: cmake --build build --parallel | |
| - name: Test | |
| run: ctest --test-dir build --output-on-failure --timeout 600 | |
| - name: Install | |
| run: | | |
| cmake --install build --prefix stage | |
| test -f stage/include/netcode.h | |
| test -f stage/lib/libnetcode.so || test -L stage/lib/libnetcode.so | |
| echo "install layout ok" | |
| sanitizers: | |
| name: sanitizers (asan+ubsan) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure | |
| run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DNETCODE_SANITIZE=ON | |
| - name: Build | |
| run: cmake --build build --parallel | |
| - name: Test | |
| run: ctest --test-dir build --output-on-failure --timeout 600 | |
| env: | |
| ASAN_OPTIONS: halt_on_error=1:abort_on_error=1 | |
| UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1:print_stacktrace=1 | |
| fuzz: | |
| name: fuzz (smoke) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Configure | |
| run: cmake -B build -DCMAKE_BUILD_TYPE=Debug -DNETCODE_SANITIZE=ON -DNETCODE_FUZZ=ON | |
| - name: Build fuzz targets | |
| run: cmake --build build --parallel --target fuzz_read_packet fuzz_connect_token fuzz_parse_address | |
| - name: Smoke fuzz | |
| run: | | |
| mkdir -p fuzz-run | |
| cd fuzz-run | |
| for target in fuzz_read_packet fuzz_connect_token fuzz_parse_address; do | |
| echo "=== $target ===" | |
| seeds="" | |
| if [ -d "../fuzz/corpus/$target" ]; then seeds="../fuzz/corpus/$target"; fi | |
| ../build/bin/$target -max_total_time=60 -rss_limit_mb=4096 -print_final_stats=1 $seeds | |
| done | |
| - name: Upload crashes | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fuzz-crashes | |
| path: | | |
| fuzz-run/crash-* | |
| fuzz-run/oom-* | |
| fuzz-run/timeout-* | |
| if-no-files-found: ignore | |
| conformance: | |
| name: STANDARD.md conformance | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Checks the wire-format specification against the implementation. The | |
| # checker parses artifacts the real library produces using ONLY what | |
| # STANDARD.md states, with no reference to the source. A failure means | |
| # the document and the code disagree — decide which is wrong, and fix | |
| # that one. A specification nothing verifies drifts, and a drifted spec | |
| # is worse than none because independent implementations are built on it. | |
| - name: Verify STANDARD.md | |
| run: python3 tools/conformance/verify_standard.py | |
| # Behaviour over time rather than bytes on the wire: drives a real client | |
| # and server through a full connection lifecycle and checks every state | |
| # transition against the machine STANDARD.md specifies. | |
| - name: Verify STANDARD.md client state machine | |
| run: python3 tools/conformance/verify_state_machine.py |