diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 274c2843..7c9c1955 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -34,7 +34,7 @@ jobs: - uses: erlef/setup-beam@v1.18.2 with: - otp-version: 24.3.4 + otp-version: '27' - name: Build cpp run: make build-nif diff --git a/.github/workflows/cover.yaml b/.github/workflows/cover.yaml index aa233201..3c4a0096 100644 --- a/.github/workflows/cover.yaml +++ b/.github/workflows/cover.yaml @@ -10,9 +10,9 @@ jobs: strategy: matrix: otp: - - 25.3.2 + - '27' rebar3: - - 3.20.0 + - '3.23.0' build_type: - RelWithDebInfo logging: diff --git a/.github/workflows/lux.yml b/.github/workflows/lux.yml index 3fd8da2d..452bd048 100644 --- a/.github/workflows/lux.yml +++ b/.github/workflows/lux.yml @@ -7,8 +7,8 @@ jobs: strategy: matrix: otp: - - 25.3.2 - - 26.2.1 + - '26.2.1' + - '27.2' steps: - name: Checkout uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 @@ -17,7 +17,7 @@ jobs: - uses: erlef/setup-beam@v1.18.2 with: otp-version: ${{ matrix.otp }} - rebar3-version: 3.23.0 + rebar3-version: '3.23.0' - name: build lux run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cb2b9124..e9a33488 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,8 @@ jobs: - name: Prepare OTP and rebar3 uses: erlef/setup-beam@v1.18.2 with: - otp-version: 26 - rebar3-version: 3.20.0 + otp-version: '27' + rebar3-version: '3.23.0' - name: Run erlfmt for erlang code run: | rebar3 fmt -c @@ -30,7 +30,9 @@ jobs: os: - macos-14 otp: - - 26 + - '27' + rebar3: + - '3.23.0' openssl: - openssl3 - openssl @@ -57,7 +59,7 @@ jobs: env: QUICER_TLS_VER: ${{ matrix.openssl }} run: | - wget https://s3.amazonaws.com/rebar3/rebar3 + wget https://github.com/erlang/rebar3/releases/download/${{ matrix.rebar3 }}/rebar3 sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3 erl -eval 'erlang:display(erlang:system_info(system_version)),halt()' ulimit -c unlimited @@ -92,15 +94,15 @@ jobs: matrix: # https://builds.hex.pm/builds/otp/ubuntu-22.04/builds.txt otp: - - 25.3.2.9 - - 26.2.5.3 - - 27.1 + - '25.3.2.9' + - '26.2.5.3' + - '27.2' openssl: - openssl3 - openssl - sys rebar3: - - 3.23.0 + - '3.23.0' build_type: - RelWithDebInfo - Debug diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 180d583a..0b97979c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,25 +7,32 @@ on: description: 'Ref to release' required: false default: '' + ref_name: + description: 'Tag to (re)release' + required: false push: tags: - "*" branches: - 'ci/**' + jobs: mac: strategy: fail-fast: false matrix: otp: - - 26 + - '26' + - '27' + rebar3: + - '3.23.0' openssl: - openssl3 - openssl - sys os: - macos-14 - - macos-13 + - macos-15 runs-on: ${{ matrix.os }} steps: @@ -47,18 +54,16 @@ jobs: ref: ${{ github.event.inputs.ref }} - name: build release - if: startsWith(github.ref, 'refs/tags/') env: QUICER_TLS_VER: ${{ matrix.openssl }} run: | - wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3 + wget https://github.com/erlang/rebar3/releases/download/${{ matrix.rebar3 }}/rebar3 sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3 erl -eval 'erlang:display(erlang:system_info(system_version)),halt()' export QUICER_TLS_VER BUILD_RELEASE=1 make - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: startsWith(github.ref, 'refs/tags/') with: name: quicer-${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.openssl }} path: | @@ -69,8 +74,11 @@ jobs: strategy: fail-fast: false matrix: - otp: - - 26.2.5.2-1 + erlang: + - otp: 26.2.5.2-3 + builder: 5.4-4:1.15.7-26.2.5.2-3 + - otp: 27.2-2 + builder: 5.4-4:1.17.3-27.2-2 openssl: - openssl3 - openssl @@ -95,11 +103,7 @@ jobs: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 with: fetch-depth: 0 - - - name: install rebar3 - run: | - wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3 - cp ./rebar3 /usr/local/bin/rebar3 + ref: ${{ github.event.inputs.ref }} - uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 @@ -108,20 +112,21 @@ jobs: platforms: ${{ matrix.arch }} - name: build release - if: startsWith(github.ref, 'refs/tags/') run: | - IMAGE=ghcr.io/emqx/emqx-builder/5.3-13:1.15.7-${{ matrix.otp }}-${{ matrix.os }} - docker run -i --rm -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} \ - -e BUILD_RELEASE=1 -e QUICER_TLS_VER=${{ matrix.openssl }} \ - $IMAGE bash -euc 'git config --global --add safe.directory /wd; \ - grep -q "\"Amazon Linux 2\"" /etc/os-release && alternatives --set python /usr/bin/python2; \ - which yum && yum install -y perl-IPC-Cmd; \ - make' + docker run -i --rm -v $(pwd):/wd --workdir /wd \ + --platform=linux/${{ matrix.arch }} \ + -e BUILD_RELEASE=1 \ + -e QUICER_TLS_VER=${{ matrix.openssl }} \ + ghcr.io/emqx/emqx-builder/${{ matrix.erlang.builder }}-${{ matrix.os }} \ + bash -euc '\ + git config --global --add safe.directory /wd; \ + grep -q "\"Amazon Linux 2\"" /etc/os-release && alternatives --set python /usr/bin/python2; \ + which yum && yum install -y perl-IPC-Cmd; \ + make' - uses: actions/upload-artifact@v4 - if: startsWith(github.ref, 'refs/tags/') with: - name: quicer-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.otp }}-${{ matrix.openssl }} + name: quicer-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.erlang.otp }}-${{ matrix.openssl }} path: | _packages/*.gz _packages/*.gz.sha256 @@ -131,7 +136,7 @@ jobs: needs: - mac - emqx-linux - if: startsWith(github.ref, 'refs/tags/') + if: github.event.inputs.ref_name || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) steps: - uses: actions/download-artifact@v4 with: @@ -141,7 +146,8 @@ jobs: - name: Create Release uses: softprops/action-gh-release@v2 with: - name: quicer ${{ github.ref_name }} Released + name: quicer ${{ github.event.inputs.ref_name || github.ref_name }} Released + tag_name: ${{ github.event.inputs.ref_name || github.ref_name }} files: packages/* draft: true prerelease: false diff --git a/test/quicer_test_lib.erl b/test/quicer_test_lib.erl index 5d8a280b..eceb236c 100644 --- a/test/quicer_test_lib.erl +++ b/test/quicer_test_lib.erl @@ -402,7 +402,13 @@ report_active_connections() -> report_active_connections(fun ct:comment/2). report_active_connections(LogFun) -> erlang:garbage_collect(), - {ok, Cnts} = quicer:perf_counters(), + case quicer:perf_counters() of + {ok, Cnts} -> + ok; + {error, not_found} -> + %% Library is likely not loaded. + Cnts = [{strm_active, 0}, {conn_active, 0}] + end, ActiveStrms = proplists:get_value(strm_active, Cnts), ActiveConns = proplists:get_value(conn_active, Cnts), 0 =/= (ActiveStrms + ActiveConns) andalso