From 9cc5e27d6d57a5b2d0a30db76033eb80276c0d03 Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Mon, 12 Aug 2024 08:57:59 -0700 Subject: [PATCH] [CI only] Streamlined/fixed sanitize/coverage matrices --- .github/workflows/build-test.yml | 36 ++++++++------- .github/workflows/on-pr-debug.yml | 73 +++++++++++++++++-------------- 2 files changed, 61 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e1b43848d..cf96b75e6 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -13,15 +13,18 @@ on: dev_mode: type: string default: "OFF" - lib_msg_delivery: + pool_dispatch: type: string - default: "OFF" - lib_write_deadline: + default: "NO-pool" + write_deadline: type: string - default: "OFF" - lib_force_host_verification: + default: "NO-write_deadline" + tls: type: string - default: "ON" + default: "TLS" + verify_host: + type: string + default: "verify_host" repeat: type: string default: "1" @@ -35,9 +38,6 @@ on: streaming: type: string default: "ON" - tls: - type: string - default: "ON" type: type: string description: "Debug or Release." @@ -88,11 +88,20 @@ jobs: flags: -DNATS_BUILD_ARCH=${{ inputs.arch }} -DCMAKE_BUILD_TYPE=${{ inputs.type }} -DNATS_BUILD_STREAMING=${{ inputs.streaming }} - -DNATS_BUILD_WITH_TLS=${{ inputs.tls }} -DNATS_PROTOBUF_DIR=${{ github.workspace}}/deps/pbuf -DNATS_BUILD_USE_SODIUM=ON -DNATS_SODIUM_DIR=${{ github.workspace}}/deps/sodium run: | + if [[ "${{ inputs.tls }}" == "TLS" ]]; then + flags="$flags -DNATS_BUILD_WITH_TLS=ON" + if [[ "${{ inputs.verify_host }}" == "verify_host" ]]; then + flags="$flags -DNATS_BUILD_TLS_FORCE_HOST_VERIFY=ON" + else + flags="$flags -DNATS_BUILD_TLS_FORCE_HOST_VERIFY=OFF" + fi + else + flags="$flags -DNATS_BUILD_WITH_TLS=OFF" + fi if [[ -n "${{ inputs.sanitize }}" ]]; then flags="$flags -DNATS_SANITIZE=ON -DCMAKE_C_FLAGS=-fsanitize=${{ inputs.sanitize }}" fi @@ -113,15 +122,12 @@ jobs: if [[ -n "${{ inputs.sanitize }}" ]]; then echo "NATS_TEST_VALGRIND=yes" >> $GITHUB_ENV fi - if [[ "${{ inputs.lib_msg_delivery }}" == "ON" ]]; then + if [[ "${{ inputs.pool_dispatch }}" == "pool" ]]; then echo "NATS_DEFAULT_TO_LIB_MSG_DELIVERY=yes" >> $GITHUB_ENV fi - if [[ "${{ inputs.lib_write_deadline }}" == "ON" ]]; then + if [[ "${{ inputs.write_deadline }}" == "write_deadline" ]]; then echo "NATS_DEFAULT_LIB_WRITE_DEADLINE=2000" >> $GITHUB_ENV fi - if [[ "${{ inputs.lib_force_host_verification }}" == "ON" ]]; then - echo "NATS_FORCE_HOST_VERIFICATION=yes" >> $GITHUB_ENV - fi echo "CC=${{ inputs.compiler }}" >> $GITHUB_ENV # install build dependencies diff --git a/.github/workflows/on-pr-debug.yml b/.github/workflows/on-pr-debug.yml index 3e9bd5cda..fe1a1d0e7 100644 --- a/.github/workflows/on-pr-debug.yml +++ b/.github/workflows/on-pr-debug.yml @@ -18,27 +18,6 @@ jobs: server_version: main type: Debug - coverage: - name: "Coverage" - uses: ./.github/workflows/build-test.yml - with: - coverage: ON - server_version: main - type: Debug - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - coverage-pooled: - name: "Coverage (pooled delivery)" - uses: ./.github/workflows/build-test.yml - with: - coverage: ON - server_version: main - type: Debug - lib_msg_delivery: ON - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - dev-mode: name: "DEV_MODE" uses: ./.github/workflows/build-test.yml @@ -56,33 +35,61 @@ jobs: matrix: compiler: [gcc, clang] sanitize: [address, thread] - pooled_delivery: [ON, OFF] + pooled_dispatch: [pool, NO-pool] uses: ./.github/workflows/build-test.yml with: server_version: main - type: Debug + type: RelWithDebInfo compiler: ${{ matrix.compiler }} sanitize: ${{ matrix.sanitize }} - lib_msg_delivery: ${{ matrix.pooled_delivery }} + pool_dispatch: ${{ matrix.pooled_dispatch }} - sanitize-write-deadline: - name: "Sanitize address (write_deadline)" + coverage-TLS: + name: "Coverage: TLS" + strategy: + fail-fast: false + matrix: + pooled_dispatch: [pool, NO-pool] + write_deadline: [write_deadline, NO-write_deadline] uses: ./.github/workflows/build-test.yml with: + coverage: ON type: RelWithDebInfo - sanitize: address server_version: main - lib_write_deadline: ON + compiler: gcc + tls: TLS + verify_host: verify_host + pool_dispatch: ${{ matrix.pooled_dispatch }} + write_deadline: ${{ matrix.write_deadline }} + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - sanitize-no-host-verify: - name: "Sanitize address (NO force_host_verification)" + coverage-NO-verify_host: + name: "Coverage: NO-verify_host" uses: ./.github/workflows/build-test.yml with: + coverage: ON type: RelWithDebInfo - sanitize: address server_version: main - lib_force_host_verification: OFF - + compiler: gcc + tls: TLS + verify_host: NO-verify_host + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + coverage-NO-TLS: + name: "Coverage NO-TLS" + uses: ./.github/workflows/build-test.yml + with: + coverage: ON + type: RelWithDebInfo + server_version: main + compiler: gcc + tls: NO-TLS + verify_host: NO-verify_host + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + bench: name: "Benchmark" uses: ./.github/workflows/build-test.yml