Repository navigation
167 lines (163 loc) · 6.71 KB
/
Copy pathci.yml
File metadata and controls
167 lines (163 loc) · 6.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CI
# The test suite on macOS (kqueue), Linux x64 (epoll, io_uring) and Windows (IOCP, WSAPoll), and Autobahn|Testsuite in
# both directions with and without permessage-deflate (SPEC §11.4, §11.7). Any branch, PRs, or by hand.
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
name: test (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- { name: macOS kqueue, os: macos-14, task: macosArm64Test, driver: "" }
- { name: Linux epoll, os: ubuntu-latest, task: linuxX64Test, driver: epoll }
- { name: Linux io_uring, os: ubuntu-latest, task: linuxX64Test, driver: iouring }
- { name: Windows IOCP, os: windows-latest, task: mingwX64Test, driver: "" }
- { name: Windows WSAPoll, os: windows-latest, task: mingwX64Test, driver: wsapoll }
runs-on: ${{ matrix.os }}
timeout-minutes: 60
env:
NETON_IO_DRIVER: ${{ matrix.driver }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- uses: gradle/actions/setup-gradle@v4
- name: Cache Kotlin/Native toolchain
uses: actions/cache@v4
with:
path: ~/.konan
key: konan-${{ runner.os }}-${{ hashFiles('**/*.gradle.kts', 'gradle/libs.versions.toml') }}
- name: Test
shell: bash
run: ./gradlew :websocket:${{ matrix.task }} --no-daemon --stacktrace --continue
- name: Summary
if: always()
shell: bash
run: |
python3 - <<'PY' >> "$GITHUB_STEP_SUMMARY"
import glob, re
tests = fails = 0; failed = []
for f in glob.glob('websocket/build/test-results/**/*.xml', recursive=True):
s = open(f, encoding='utf-8', errors='replace').read()
m = re.search(r'tests="(\d+)"', s); tests += int(m.group(1)) if m else 0
for c in re.finditer(r'<testcase name="([^"]+)" classname="([^"]+)"[^>]*>\s*<failure message="([^"]*)"', s):
fails += 1; failed.append(f"- {c.group(2)}.{c.group(1)}: {c.group(3)[:300]}")
print(f"### ${{ matrix.name }}: {tests} tests, {fails} failures")
print("\n".join(failed))
PY
- if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.name }}
path: |
websocket/build/test-results/**
websocket/build/reports/tests/**
if-no-files-found: ignore
autobahn:
name: autobahn (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- { name: plain, compression: "0" }
- { name: permessage-deflate, compression: "1" }
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- uses: gradle/actions/setup-gradle@v4
- name: Cache Kotlin/Native toolchain
uses: actions/cache@v4
with:
path: ~/.konan
key: konan-${{ runner.os }}-${{ hashFiles('**/*.gradle.kts', 'gradle/libs.versions.toml') }}
- name: Build the drivers
run: >
./gradlew --no-daemon --stacktrace
:websocket-bench:linkAutobahnServerReleaseExecutableLinuxX64 :websocket-bench:linkAutobahnClientReleaseExecutableLinuxX64
- name: Run Autobahn|Testsuite
env:
CONTAINER: docker
NETON_WS_COMPRESSION: ${{ matrix.compression }}
AUTOBAHN_CASES: ${{ matrix.cases }}
# Pinned: 25.10.1 (what :latest was in every run so far), by digest so a re-tag cannot change the suite.
AUTOBAHN_IMAGE: crossbario/autobahn-testsuite:25.10.1@sha256:519915fb568b04c9383f70a1c405ae3ff44ab9e35835b085239c258b6fac3074
run: |
mkdir -p ab && cp -r bench/autobahn/config ab/
cp websocket-bench/build/bin/linuxX64/autobahnServerReleaseExecutable/autobahnServer.kexe ab/
cp websocket-bench/build/bin/linuxX64/autobahnClientReleaseExecutable/autobahnClient.kexe ab/
docker pull -q "$AUTOBAHN_IMAGE"
bash bench/autobahn/run.sh "$PWD/ab" "$AUTOBAHN_IMAGE" | tee ab/summary.txt
exit ${PIPESTATUS[0]}
- name: Summary
if: always()
run: |
{ echo "### autobahn ${{ matrix.name }}"; echo '```'; cat ab/summary.txt 2>/dev/null; echo '```'; } >> "$GITHUB_STEP_SUMMARY"
- if: always()
uses: actions/upload-artifact@v4
with:
name: autobahn-${{ matrix.name }}
path: |
ab/reports/**
ab/*.log
ab/summary.txt
if-no-files-found: ignore
test-jvm:
# The JVM target (desktop and Android apps): the same suite over neton-io's NIO reactor; deflate via java.util.zip.
# On each GitHub host, on JDK 8 (the oldest the bytecode targets) and 21; Gradle itself runs on 17.
name: test (JVM ${{ matrix.os }} JDK ${{ matrix.jdk }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14, windows-latest]
jdk: ['8', '21']
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
id: test-jdk
with:
distribution: zulu
java-version: ${{ matrix.jdk }}
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- uses: gradle/actions/setup-gradle@v4
- name: Test
shell: bash
run: ./gradlew :websocket:jvmTest -PtestJavaHome="${{ steps.test-jdk.outputs.path }}" --no-daemon --stacktrace --continue
- name: Summary
if: always()
shell: bash
run: |
python3 - <<'PY' >> "$GITHUB_STEP_SUMMARY"
import glob, re
tests = fails = 0; failed = []
for f in glob.glob('websocket/build/test-results/jvmTest/*.xml'):
s = open(f, encoding='utf-8', errors='replace').read()
m = re.search(r'tests="(\d+)"', s); tests += int(m.group(1)) if m else 0
for c in re.finditer(r'<testcase name="([^"]+)" classname="([^"]+)"[^>]*>\s*<failure message="([^"]*)"', s):
fails += 1; failed.append(f"- {c.group(2)}.{c.group(1)}: {c.group(3)[:300]}")
print(f"### JVM ${{ matrix.os }} JDK ${{ matrix.jdk }}: {tests} tests, {fails} failures")
print("\n".join(failed))
PY
- if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-JVM ${{ matrix.os }} JDK ${{ matrix.jdk }}
path: |
*/build/test-results/jvmTest/**
*/build/reports/tests/jvmTest/**
if-no-files-found: ignore