Files
wolfssl/.github/workflows/async-examples.yml
T
Juliusz Sosinowicz 844852202b .github: bump JavaScript actions to Node.js 24 runtimes
GitHub Actions now emits "Node.js 20 actions are deprecated" warnings:
actions are forced to Node.js 24 by default starting 2026-06-16, and
Node.js 20 is removed from the runners on 2026-09-16. Update every
JavaScript action referenced by the workflows and the local composite
actions to the lowest release that runs on Node.js 24:

  actions/checkout              v4     -> v5
  actions/checkout (SHA pin)    v4.1.7 -> v5
  actions/upload-artifact       v4     -> v6   (v5 still Node.js 20)
  actions/download-artifact     v4     -> v7   (v5/v6 still Node.js 20)
  actions/cache[/restore|/save] v4     -> v5
  actions/setup-python          v5     -> v6
  actions/github-script         v7     -> v8
  docker/setup-buildx-action    v3     -> v4
  docker/build-push-action      v5     -> v7   (v6 still Node.js 20)
  docker/login-action           v3     -> v4
  microsoft/setup-msbuild       v2     -> v3
  open-watcom/setup-watcom      v0     -> v1

Actions already running on Node.js 24 (jwlawson/actions-setup-cmake,
shogo82148/actions-setup-perl, msys2/setup-msys2, dorny/paths-filter)
are left unchanged. These bumps are runtime-only; no workflow uses an
input or output removed by the new majors, and v4-format artifacts
remain compatible across the upload v6 / download v7 backends.
2026-06-15 18:09:04 +00:00

113 lines
3.5 KiB
YAML

name: Async Examples
on:
push:
branches: [ 'release/**' ]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
async_examples:
if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
async_mode: ['sw', 'cryptocb']
extra_cflags:
- ''
- '-DWOLFSSL_SMALL_CERT_VERIFY'
- '-DWOLFSSL_STATIC_MEMORY'
name: Async Examples (${{ matrix.async_mode }}, ${{ matrix.extra_cflags || 'default' }})
steps:
- uses: actions/checkout@v5
name: Checkout wolfSSL
- name: Build async examples (no configure)
run: |
make -C examples/async clean
make -j -C examples/async ASYNC_MODE=${{ matrix.async_mode }} EXTRA_CFLAGS="${{ matrix.extra_cflags }}"
- name: Run async examples
run: |
set -euo pipefail
ASYNC_MODE="${{ matrix.async_mode }}"
MIN_PENDING=100
run_pair() {
local label="$1"
shift
local args="$*"
local ready="/tmp/wolfssl_async_ready_${label}"
rm -f "$ready"
WOLFSSL_ASYNC_READYFILE="$ready" \
./examples/async/async_server $args \
> "/tmp/async_server_${label}.log" 2>&1 &
local pid=$!
WOLFSSL_ASYNC_READYFILE="$ready" \
./examples/async/async_client $args 127.0.0.1 11111 \
> "/tmp/async_client_${label}.log" 2>&1
local rc=$?
kill "$pid" >/dev/null 2>&1 || true
wait "$pid" >/dev/null 2>&1 || true
if [ "$rc" -ne 0 ]; then
echo "FAIL: $label (exit=$rc)"
return 1
fi
# Validate WC_PENDING_E count for sw mode only
# cryptocb mode uses callback pending which isn't tracked the same way
if [ "$ASYNC_MODE" = "sw" ]; then
local count
count=$(awk '/WC_PENDING_E count:/ {print $NF}' \
"/tmp/async_client_${label}.log")
if [ -z "$count" ] || [ "$count" -lt "$MIN_PENDING" ]; then
echo "FAIL: $label - WC_PENDING_E count too low:" \
"${count:-missing} (expected >= $MIN_PENDING)"
return 1
fi
echo "PASS: $label (WC_PENDING_E: $count)"
else
echo "PASS: $label (cryptocb mode - connection successful)"
fi
return 0
}
# TLS 1.3
run_pair ecc_tls13 --ecc
run_pair x25519_tls13 --x25519
# TLS 1.2
run_pair ecc_tls12 --tls12 --ecc
run_pair x25519_tls12 --tls12 --x25519
# TLS 1.3 mutual auth
run_pair ecc_tls13_mutual --mutual --ecc
run_pair x25519_tls13_mutual --mutual --x25519
# TLS 1.2 mutual auth
run_pair ecc_tls12_mutual --mutual --tls12 --ecc
run_pair x25519_tls12_mutual --mutual --tls12 --x25519
- name: Print async logs
if: ${{ failure() }}
run: |
for f in /tmp/async_server_*.log /tmp/async_client_*.log; do
if [ -f "$f" ]; then
echo "==> $f"
cat "$f"
fi
done