Skip to content

Commit

Permalink
Merge pull request #338 from keynslug/main
Browse files Browse the repository at this point in the history
ci: switch workflows to recent Erlang/OTP 27
  • Loading branch information
qzhuyan authored Jan 15, 2025
2 parents c50455e + 3f502a0 commit bc6ef63
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
languages: ${{ matrix.language }}
queries: +security-and-quality

- uses: erlef/setup-beam@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.17.5
- uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
with:
otp-version: 24.3.4
otp-version: '27'

- name: Build cpp
run: make build-nif
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
strategy:
matrix:
otp:
- 25.3.2
- '27'
rebar3:
- 3.20.0
- '3.23.0'
build_type:
- RelWithDebInfo
logging:
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- uses: erlef/setup-beam@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.17.5
- uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{ matrix.rebar3 }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ 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
with:
submodules: recursive
- uses: erlef/setup-beam@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.17.5
- uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
with:
otp-version: ${{ matrix.otp }}
rebar3-version: 3.23.0
rebar3-version: '3.23.0'

- name: build lux
run: |
Expand Down
28 changes: 15 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
clang-format-version: '13'
check-path: 'c_src'
- name: Prepare OTP and rebar3
uses: erlef/setup-beam@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.17.5
uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # 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
Expand All @@ -31,15 +31,15 @@ jobs:
matrix:
# https://builds.hex.pm/builds/otp/ubuntu-22.04/builds.txt
otp:
- 26.2.5.3
- '27'
rebar3:
- 3.23.0
- '3.23.0'
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
submodules: recursive
- uses: erlef/setup-beam@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.17.5
- uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{ matrix.rebar3 }}
Expand All @@ -63,7 +63,9 @@ jobs:
- macos-14
- macos-15
otp:
- 26
- '27'
rebar3:
- '3.23.0'
openssl:
- openssl3
- openssl
Expand Down Expand Up @@ -91,7 +93,7 @@ jobs:
QUICER_TLS_VER: ${{ matrix.openssl }}
run: |
export QUICER_TLS_VER
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
Expand Down Expand Up @@ -126,15 +128,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
Expand All @@ -148,7 +150,7 @@ jobs:
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
submodules: recursive
- uses: erlef/setup-beam@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.17.5
- uses: erlef/setup-beam@5304e04ea2b355f03681464e683d92e3b2f18451 # v1.18.2
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{ matrix.rebar3 }}
Expand Down
54 changes: 30 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
8 changes: 7 additions & 1 deletion test/quicer_test_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc6ef63

Please sign in to comment.