Skip to content

Build on io 0.3.1

Build on io 0.3.1 #5

Workflow file for this run

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 }}
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 crossbario/autobahn-testsuite
bash bench/autobahn/run.sh "$PWD/ab" crossbario/autobahn-testsuite | 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