Skip to content

feat: Basic GSO support #6281

feat: Basic GSO support

feat: Basic GSO support #6281

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
merge_group:
workflow_dispatch:
inputs:
run_benchmarks:
description: 'Run benchmarks'
type: boolean
required: false
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
toolchains:
runs-on: ubuntu-24.04
outputs:
toolchains: ${{ steps.toolchains.outputs.toolchains }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout: Cargo.toml
persist-credentials: false
- id: toolchains
run: |
msrv="$(grep rust-version Cargo.toml | tr -d '"' | cut -f3 -d\ )"
echo "toolchains=[\"$msrv\", \"stable\", \"nightly\"]" >> "$GITHUB_OUTPUT"
check:
needs: toolchains
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-2025]
rust-toolchain: ${{ fromJSON(needs.toolchains.outputs.toolchains) }}
type: [debug]
include:
- os: ubuntu-24.04
rust-toolchain: stable
type: release
env:
BUILD_TYPE: ${{ matrix.type == 'release' && '--release' || '' }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: ./.github/actions/rust
with:
version: ${{ matrix.rust-toolchain }}
components: ${{ matrix.rust-toolchain == 'nightly' && 'llvm-tools' || '' }}
tools: ${{ matrix.rust-toolchain == 'nightly' && 'cargo-llvm-cov, ' || '' }} cargo-nextest
token: ${{ secrets.GITHUB_TOKEN }}
- id: nss-version
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/nss
with:
minimum-version: ${{ steps.nss-version.outputs.minimum }}
- name: Check
run: |
# shellcheck disable=SC2086
cargo check $BUILD_TYPE --locked --all-targets --features ci
- name: Run tests and determine coverage
env:
RUST_LOG: trace
RUST_BACKTRACE: 1
TOOLCHAIN: ${{ matrix.rust-toolchain }}
run: |
DUMP_SIMULATION_SEEDS="$(pwd)/simulation-seeds"
export DUMP_SIMULATION_SEEDS
# shellcheck disable=SC2086
if [ "$TOOLCHAIN" == "nightly" ]; then
cargo llvm-cov nextest $BUILD_TYPE --locked --mcdc --include-ffi --features ci --profile ci --codecov --output-path codecov.json
else
cargo nextest run $BUILD_TYPE --locked --features ci --profile ci
fi
- name: Run client/server transfer
run: |
# shellcheck disable=SC2086
cargo build $BUILD_TYPE --bin neqo-client --bin neqo-server
"target/$BUILD_DIR/neqo-server" "$HOST:4433" &
PID=$!
# Give the server time to start.
sleep 1
"target/$BUILD_DIR/neqo-client" --output-dir . "https://$HOST:4433/$SIZE"
kill $PID
[ "$(wc -c <"$SIZE")" -eq "$SIZE" ] || exit 1
env:
HOST: localhost
SIZE: 54321
RUST_LOG: warn
BUILD_DIR: ${{ matrix.type == 'release' && 'release' || 'debug' }}
- uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
with:
files: codecov.json
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ matrix.type == 'debug' && matrix.rust-toolchain == 'nightly' }}
- uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0
if: ${{ always() }}
with:
files: target/nextest/ci/junit.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: Save simulation seeds artifact
if: ${{ always() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: simulation-seeds-${{ matrix.os }}-${{ matrix.rust-toolchain }}-${{ matrix.type }}
path: simulation-seeds
compression-level: 9
check-cargo-lock:
name: Ensure `Cargo.lock` contains all required dependencies
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- run: cargo update -w --locked
bench:
needs: [check]
if: ${{ !cancelled() && (github.event_name != 'workflow_dispatch' || github.event.inputs.run_benchmarks) && github.actor != 'dependabot[bot]' }}
uses: ./.github/workflows/bench.yml
check-android:
runs-on: ubuntu-latest
env:
# https://searchfox.org/mozilla-central/search?q=NDK_VERSION =&path=python/mozboot/mozboot/android.py
NDK_VERSION: 27.2.12479018 # r27c
# https://searchfox.org/mozilla-central/search?q=\bapi_level=&path=taskcluster/scripts/misc/build-llvm-common.sh&regexp=true
# However, NSS requires an API >= 23 for a few symbols.
API_LEVEL: 23
strategy:
matrix:
include:
- target: x86_64-linux-android
emulator-arch: x86_64
# Note that x86_64 image is only available for API 21+. See
# https://github.com/ReactiveCircus/android-emulator-runner?tab=readme-ov-file#configurations.
- target: i686-linux-android
emulator-arch: x86
# FIXME: https://github.com/ReactiveCircus/android-emulator-runner/issues/404
# - target: armv7-linux-androideabi
# emulator-arch: arm64-v8
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
distribution: zulu
java-version: 23
- uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
- run: sdkmanager --install "ndk;${{ env.NDK_VERSION }}"
- uses: ./.github/actions/rust
with:
version: stable
targets: ${{ matrix.target }}
tools: cargo-ndk
token: ${{ secrets.GITHUB_TOKEN }}
- id: nss-version
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/nss
with:
minimum-version: ${{ steps.nss-version.outputs.minimum }}
target: ${{ matrix.target }}
- run: cargo ndk --bindgen --platform "$API_LEVEL" --target ${{ matrix.target }} test --no-run
- env:
TARGET: ${{ matrix.target }}
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
cat <<'EOF' > /tmp/rust-android-run-tests-on-emulator.sh
#!/bin/bash
set -e
adb wait-for-device
while [ -z "$(adb shell getprop sys.boot_completed | tr -d '\r')" ]; do sleep 1; done
any_failures=0
TMP=/data/local/tmp
adb push "test-fixture/db" "$TMP/"
adb push "$LD_LIBRARY_PATH" "$TMP/"
for test in $(find target/$TARGET/debug/deps/ -type f -executable ! -name "*.so" -name "*-*"); do
adb push "$test" "$TMP/"
adb shell chmod +x "$TMP/$(basename "$test")"
# See https://unix.stackexchange.com/a/451140/409256
adb shell "CARGO_TERM_COLOR=always RUST_BACKTRACE=1 LD_LIBRARY_PATH=$TMP/lib NSS_DB_PATH=$TMP/db API_LEVEL=$API_LEVEL $TMP/$(basename "$test") || echo _FAIL_" 2>&1 | tee output
grep _FAIL_ output > /dev/null && any_failures=1
done
exit $any_failures
EOF
chmod a+x /tmp/rust-android-run-tests-on-emulator.sh
- uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0
with:
api-level: ${{ env.API_LEVEL }}
arch: ${{ matrix.emulator-arch == 'arm64-v8' && 'arm64-v8a' || matrix.emulator-arch }}
ndk: ${{ env.NDK_VERSION }}
emulator-boot-timeout: 120
disk-size: 2G
script: /tmp/rust-android-run-tests-on-emulator.sh
env:
TARGET: ${{ matrix.target }}