Skip to content

Commit a21112c

Browse files
authored
Merge pull request #339 from keynslug/main-0.1
ci: enable CI + releases targeting recent Erlang/OTP 27
2 parents d134702 + 1a2fa6a commit a21112c

File tree

6 files changed

+53
-39
lines changed

6 files changed

+53
-39
lines changed

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- uses: erlef/setup-beam@v1.18.2
3636
with:
37-
otp-version: 24.3.4
37+
otp-version: '27'
3838

3939
- name: Build cpp
4040
run: make build-nif

.github/workflows/cover.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
strategy:
1111
matrix:
1212
otp:
13-
- 25.3.2
13+
- '27'
1414
rebar3:
15-
- 3.20.0
15+
- '3.23.0'
1616
build_type:
1717
- RelWithDebInfo
1818
logging:

.github/workflows/lux.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
strategy:
88
matrix:
99
otp:
10-
- 25.3.2
11-
- 26.2.1
10+
- '26.2.1'
11+
- '27.2'
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
@@ -17,7 +17,7 @@ jobs:
1717
- uses: erlef/setup-beam@v1.18.2
1818
with:
1919
otp-version: ${{ matrix.otp }}
20-
rebar3-version: 3.23.0
20+
rebar3-version: '3.23.0'
2121

2222
- name: build lux
2323
run: |

.github/workflows/main.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
- name: Prepare OTP and rebar3
1616
uses: erlef/setup-beam@v1.18.2
1717
with:
18-
otp-version: 26
19-
rebar3-version: 3.20.0
18+
otp-version: '27'
19+
rebar3-version: '3.23.0'
2020
- name: Run erlfmt for erlang code
2121
run: |
2222
rebar3 fmt -c
@@ -30,7 +30,9 @@ jobs:
3030
os:
3131
- macos-14
3232
otp:
33-
- 26
33+
- '27'
34+
rebar3:
35+
- '3.23.0'
3436
openssl:
3537
- openssl3
3638
- openssl
@@ -57,7 +59,7 @@ jobs:
5759
env:
5860
QUICER_TLS_VER: ${{ matrix.openssl }}
5961
run: |
60-
wget https://s3.amazonaws.com/rebar3/rebar3
62+
wget https://github.com/erlang/rebar3/releases/download/${{ matrix.rebar3 }}/rebar3
6163
sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3
6264
erl -eval 'erlang:display(erlang:system_info(system_version)),halt()'
6365
ulimit -c unlimited
@@ -92,15 +94,15 @@ jobs:
9294
matrix:
9395
# https://builds.hex.pm/builds/otp/ubuntu-22.04/builds.txt
9496
otp:
95-
- 25.3.2.9
96-
- 26.2.5.3
97-
- 27.1
97+
- '25.3.2.9'
98+
- '26.2.5.3'
99+
- '27.2'
98100
openssl:
99101
- openssl3
100102
- openssl
101103
- sys
102104
rebar3:
103-
- 3.23.0
105+
- '3.23.0'
104106
build_type:
105107
- RelWithDebInfo
106108
- Debug

.github/workflows/release.yaml

+30-24
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,32 @@ on:
77
description: 'Ref to release'
88
required: false
99
default: ''
10+
ref_name:
11+
description: 'Tag to (re)release'
12+
required: false
1013
push:
1114
tags:
1215
- "*"
1316
branches:
1417
- 'ci/**'
18+
1519
jobs:
1620
mac:
1721
strategy:
1822
fail-fast: false
1923
matrix:
2024
otp:
21-
- 26
25+
- '26'
26+
- '27'
27+
rebar3:
28+
- '3.23.0'
2229
openssl:
2330
- openssl3
2431
- openssl
2532
- sys
2633
os:
2734
- macos-14
28-
- macos-13
35+
- macos-15
2936
runs-on: ${{ matrix.os }}
3037
steps:
3138

@@ -47,18 +54,16 @@ jobs:
4754
ref: ${{ github.event.inputs.ref }}
4855

4956
- name: build release
50-
if: startsWith(github.ref, 'refs/tags/')
5157
env:
5258
QUICER_TLS_VER: ${{ matrix.openssl }}
5359
run: |
54-
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
60+
wget https://github.com/erlang/rebar3/releases/download/${{ matrix.rebar3 }}/rebar3
5561
sudo mv rebar3 /usr/local/bin/ && sudo chmod +x /usr/local/bin/rebar3
5662
erl -eval 'erlang:display(erlang:system_info(system_version)),halt()'
5763
export QUICER_TLS_VER
5864
BUILD_RELEASE=1 make
5965
6066
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
61-
if: startsWith(github.ref, 'refs/tags/')
6267
with:
6368
name: quicer-${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.openssl }}
6469
path: |
@@ -69,8 +74,11 @@ jobs:
6974
strategy:
7075
fail-fast: false
7176
matrix:
72-
otp:
73-
- 26.2.5.2-1
77+
erlang:
78+
- otp: 26.2.5.2-3
79+
builder: 5.4-4:1.15.7-26.2.5.2-3
80+
- otp: 27.2-2
81+
builder: 5.4-4:1.17.3-27.2-2
7482
openssl:
7583
- openssl3
7684
- openssl
@@ -95,11 +103,7 @@ jobs:
95103
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
96104
with:
97105
fetch-depth: 0
98-
99-
- name: install rebar3
100-
run: |
101-
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
102-
cp ./rebar3 /usr/local/bin/rebar3
106+
ref: ${{ github.event.inputs.ref }}
103107

104108
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
105109

@@ -108,20 +112,21 @@ jobs:
108112
platforms: ${{ matrix.arch }}
109113

110114
- name: build release
111-
if: startsWith(github.ref, 'refs/tags/')
112115
run: |
113-
IMAGE=ghcr.io/emqx/emqx-builder/5.3-13:1.15.7-${{ matrix.otp }}-${{ matrix.os }}
114-
docker run -i --rm -v $(pwd):/wd --workdir /wd --platform=linux/${{ matrix.arch }} \
115-
-e BUILD_RELEASE=1 -e QUICER_TLS_VER=${{ matrix.openssl }} \
116-
$IMAGE bash -euc 'git config --global --add safe.directory /wd; \
117-
grep -q "\"Amazon Linux 2\"" /etc/os-release && alternatives --set python /usr/bin/python2; \
118-
which yum && yum install -y perl-IPC-Cmd; \
119-
make'
116+
docker run -i --rm -v $(pwd):/wd --workdir /wd \
117+
--platform=linux/${{ matrix.arch }} \
118+
-e BUILD_RELEASE=1 \
119+
-e QUICER_TLS_VER=${{ matrix.openssl }} \
120+
ghcr.io/emqx/emqx-builder/${{ matrix.erlang.builder }}-${{ matrix.os }} \
121+
bash -euc '\
122+
git config --global --add safe.directory /wd; \
123+
grep -q "\"Amazon Linux 2\"" /etc/os-release && alternatives --set python /usr/bin/python2; \
124+
which yum && yum install -y perl-IPC-Cmd; \
125+
make'
120126
121127
- uses: actions/upload-artifact@v4
122-
if: startsWith(github.ref, 'refs/tags/')
123128
with:
124-
name: quicer-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.otp }}-${{ matrix.openssl }}
129+
name: quicer-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.erlang.otp }}-${{ matrix.openssl }}
125130
path: |
126131
_packages/*.gz
127132
_packages/*.gz.sha256
@@ -131,7 +136,7 @@ jobs:
131136
needs:
132137
- mac
133138
- emqx-linux
134-
if: startsWith(github.ref, 'refs/tags/')
139+
if: github.event.inputs.ref_name || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
135140
steps:
136141
- uses: actions/download-artifact@v4
137142
with:
@@ -141,7 +146,8 @@ jobs:
141146
- name: Create Release
142147
uses: softprops/action-gh-release@v2
143148
with:
144-
name: quicer ${{ github.ref_name }} Released
149+
name: quicer ${{ github.event.inputs.ref_name || github.ref_name }} Released
150+
tag_name: ${{ github.event.inputs.ref_name || github.ref_name }}
145151
files: packages/*
146152
draft: true
147153
prerelease: false

test/quicer_test_lib.erl

+7-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,13 @@ report_active_connections() ->
402402
report_active_connections(fun ct:comment/2).
403403
report_active_connections(LogFun) ->
404404
erlang:garbage_collect(),
405-
{ok, Cnts} = quicer:perf_counters(),
405+
case quicer:perf_counters() of
406+
{ok, Cnts} ->
407+
ok;
408+
{error, not_found} ->
409+
%% Library is likely not loaded.
410+
Cnts = [{strm_active, 0}, {conn_active, 0}]
411+
end,
406412
ActiveStrms = proplists:get_value(strm_active, Cnts),
407413
ActiveConns = proplists:get_value(conn_active, Cnts),
408414
0 =/= (ActiveStrms + ActiveConns) andalso

0 commit comments

Comments
 (0)