Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Mar 6, 2024
1 parent 9610f0d commit 0daa272
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
15 changes: 13 additions & 2 deletions .github/actions/nss/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Fetch and build NSS

inputs:
type:
description: 'Whether to do a debug or release build of NSS'
required: true
default: 'Debug'

# This step might be removed if the distro included a recent enough
# version of NSS. Ubuntu 20.04 only has 3.49, which is far too old.
# (neqo-crypto/build.rs would also need to query pkg-config to get the
Expand Down Expand Up @@ -29,8 +35,13 @@ runs:
# we also want debug symbols for that, which the normal optimized NSS
# build process doesn't provide.
[ "${{ runner.os }}" != "Windows" ] && export CFLAGS=-ggdb3
$NSS_DIR/build.sh -g -Ddisable_tests=1 -o --static
export NSS_TARGET=$(cat "$NSS_DIR/../dist/latest")
if [ "${{ inputs.type }}" != "Debug" ]; then
export OPT="-o"
export NSS_TARGET=Release
else
export NSS_TARGET=Debug
fi
$NSS_DIR/build.sh -g -Ddisable_tests=1 $OPT --static
echo "NSS_TARGET=$NSS_TARGET" >> "$GITHUB_ENV"
export NSS_OUT="$NSS_DIR/../dist/$NSS_TARGET"
echo "LD_LIBRARY_PATH=$NSS_OUT/lib" >> "$GITHUB_ENV"
Expand Down
1 change: 0 additions & 1 deletion .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Install Rust
description: Install Rust and sccache

inputs:
version:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:

- name: Fetch and build NSS and NSPR
uses: ./.github/actions/nss
with:
type: Release

- name: Build
run: |
Expand Down Expand Up @@ -76,17 +78,16 @@ jobs:
- name: Profile client/server transfer
run: |
export PORT=$((RANDOM + 2000))
{ mkdir server; \
cd server; \
taskset -c 0 nice -n -20 \
cargo +$TOOLCHAIN flamegraph -v -c "$PERF_CMD" \
--bin neqo-server -- --db ../test-fixture/db $HOST:$PORT || true; } &
--bin neqo-server -- --db ../test-fixture/db $HOST:4433 || true; } &
mkdir client; \
cd client; \
time taskset -c 1 nice -n -20 \
cargo +$TOOLCHAIN flamegraph -v -c "$PERF_CMD" \
--bin neqo-client -- --output-dir . https://$HOST:$PORT/$SIZE
--bin neqo-client -- --output-dir . https://$HOST:4433/$SIZE
killall -INT neqo-server
cd ${{ github.workspace }}
[ "$(wc -c < client/"$SIZE")" -eq "$SIZE" ] || exit 1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
type: release
env:
BUILD_TYPE: ${{ matrix.type == 'release' && '--release' || '' }}
BUILD_DIR: ${{ matrix.type == 'release' && 'release' || 'debug' }}
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down Expand Up @@ -113,11 +114,10 @@ jobs:
- name: Run client/server transfer
run: |
export PORT=$((RANDOM + 2000))
cargo +${{ matrix.rust-toolchain }} build $BUILD_TYPE --bin neqo-client --bin neqo-server
cargo +${{ matrix.rust-toolchain }} run $BUILD_TYPE --bin neqo-server -- $HOST:$PORT &
target/$BUILD_DIR/neqo-server $HOST:4433 &
PID=$!
cargo +${{ matrix.rust-toolchain }} run $BUILD_TYPE --bin neqo-client -- --output-dir . https://$HOST:$PORT/$SIZE
target/$BUILD_DIR/neqo-client --output-dir . https://$HOST:4433/$SIZE
kill $PID
[ "$(wc -c <"$SIZE")" -eq "$SIZE" ] || exit 1
env:
Expand Down

0 comments on commit 0daa272

Please sign in to comment.